I just use wxRuby and I have problem I use background image on my app and when I create label it seem look background of label is gray, how can I change it into transparent???? -- Posted via http://www.ruby-forum.com/.
Pat Kiatchaipipat wrote:> I just use wxRuby and I have problem > > I use background image on my app and when I create label it seem look > background of label is gray, how can I change it into transparent???? >Can you show us the code you''re using here, and tell us what platform (Win/Linux/Mac) you''re using. thanks alex
Pat Kiatchaipipat
2007-Nov-19 17:09 UTC
[wxruby-users] set background label to transparent??
my code is @label1 = StaticText.new(@picturebox2, -1, ''Calculator'', Point.new(168,38), Size.new(213, 39)) @label1.set_foreground_colour(Colour.new(255, 0, 255)) @label1.set_font(Font.new(15, FONTFAMILY_DEFAULT, BOLD, FONTWEIGHT_NORMAL, FALSE, ''Kristen ITC'')) @picturebox2 is image background that I add to Panel I set like this and output it''s can work completely but background of ''Calculator'' label is gray and other label be the same :''( see my attachment picture Attachments: http://www.ruby-forum.com/attachment/1012/1.jpg -- Posted via http://www.ruby-forum.com/.
Pat Kiatchaipipat
2007-Nov-19 17:10 UTC
[wxruby-users] set background label to transparent??
ah I use in Window -- Posted via http://www.ruby-forum.com/.
Pat Kiatchaipipat wrote:> @label1 = StaticText.new(@picturebox2, -1, ''Calculator'', > Point.new(168,38), Size.new(213, 39)) > @label1.set_foreground_colour(Colour.new(255, 0, 255)) > @label1.set_font(Font.new(15, FONTFAMILY_DEFAULT, BOLD, > FONTWEIGHT_NORMAL, FALSE, ''Kristen ITC'')) > > @picturebox2 is image background that I add to Panel > I set like this and output it''s can work completely but background of > ''Calculator'' label is gray and other label be the same :''( >On Windows at least, StaticText always draws its background in the theme background colour. Instead of using StaticText, I would suggest drawing the text directly onto the bitmap using a DC (DeviceContext), inside an evt_paint event. Use draw_bitmap to paint the bitmap onto the frame, then draw_text to draw the text atop it. The simplest example of this can be found in the dialogs/dialogs.rb sample - search for on_paint method. hth alex