位图作为按钮? [英] Bitmaps as buttons?
问题描述
我想创建位图形状的按钮 - 即没有方形
围绕它们。
我该怎么办?
谢谢,
Flash
I want to create buttons in the shape of bitmaps - i.e. without a square
around them.
How would I do this?
Thanks,
Flash
推荐答案
" Flashster" < FL *********** @ hotmail.com> schrieb:
"Flashster" <fl***********@hotmail.com> schrieb:
我想创建位图形状的按钮 - 即周围没有方形
。
I want to create buttons in the shape of bitmaps - i.e. without a square
around them.
创建一个继承自的方法按钮。然后创建一个适当形状的''Region''对象
并将其分配给
运行时的控件'''Region''属性,并覆盖该控件'''OnPaint''将位图绘制到
按钮上的方法。
-
MS Herfried K 。瓦格纳
MVP< URL:http://dotnet.mvps.org/>
VB< URL:http://classicvb.org/petition/ >
Create a class which inherits from ''Button''. Then create a ''Region'' object
of appropriate shape and assign it to the control''s ''Region'' property at
runtime, and override the control''s ''OnPaint'' method to draw the bitmap onto
the button.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
有没有办法使用位图的掩码指定''Region'或
类似的方法?
如果可能的话,我不希望以编程方式为每个区域绘制区域,并且按钮形状上的每个点都是
。
" Herfried K. Wagner [MVP]" <喜*************** @ gmx.at>在消息中写道
news:uI ************** @ TK2MSFTNGP10.phx.gbl ...
Is there a way of specifying the ''Region'' using a mask of the bitmap or
similar method?
I would prefer not to have to draw the region programmatically for each and
every point on a button shape if possible.
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:uI**************@TK2MSFTNGP10.phx.gbl...
" Flashster" < FL *********** @ hotmail.com> schrieb:
"Flashster" <fl***********@hotmail.com> schrieb:
我想创建位图形状的按钮 - 即周围没有方形
。
I want to create buttons in the shape of bitmaps - i.e. without a square
around them.
创建一个继承自的方法按钮。然后创建一个具有适当形状的Region对象,并在运行时将其分配给控件'''Region''属性,并覆盖控件''''OnPaint''将位图绘制到按钮上的方法。
- MS Herfried K. Wagner
MVP< URL:http://dotnet.mvps.org />
VB< URL:http://classicvb.org/petition/>
Create a class which inherits from ''Button''. Then create a ''Region''
object of appropriate shape and assign it to the control''s ''Region''
property at runtime, and override the control''s ''OnPaint'' method to draw
the bitmap onto the button.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
您还可以使用图片框对于按钮...它有点击事件。
-
休斯顿的丹尼斯
" Flashster"写道:
You could also use a picture box for the button...it has click events.
--
Dennis in Houston
"Flashster" wrote:
有没有办法使用位图的掩码或
类似的方法指定''Region'?
我宁愿没有如果可能的话,以编程方式为每个区域和按钮形状上的每个点绘制区域。
" Herfried K. Wagner [MVP]" <喜*************** @ gmx.at>在消息中写道
新闻:uI ************** @ TK2MSFTNGP10.phx.gbl ...
Is there a way of specifying the ''Region'' using a mask of the bitmap or
similar method?
I would prefer not to have to draw the region programmatically for each and
every point on a button shape if possible.
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:uI**************@TK2MSFTNGP10.phx.gbl...
" Flashster" < FL *********** @ hotmail.com> schrieb:
"Flashster" <fl***********@hotmail.com> schrieb:
我想创建位图形状的按钮 - 即周围没有方形
。
I want to create buttons in the shape of bitmaps - i.e. without a square
around them.
创建一个继承自的方法按钮。然后创建一个具有适当形状的Region对象,并在运行时将其分配给控件'''Region''属性,并覆盖控件''''OnPaint''将位图绘制到按钮上的方法。
- MS Herfried K. Wagner
MVP< URL:http://dotnet.mvps.org />
VB< URL:http://classicvb.org/petition/>
Create a class which inherits from ''Button''. Then create a ''Region''
object of appropriate shape and assign it to the control''s ''Region''
property at runtime, and override the control''s ''OnPaint'' method to draw
the bitmap onto the button.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
这篇关于位图作为按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!