[fxruby-users] Display an arrow, or transparent image colors

Lyle Johnson lyle at knology.net
Mon Apr 10 20:29:24 EDT 2006

On Apr 10, 2006, at 4:35 PM, Tobias Herzke wrote:

> Using this program, my red arrow will display on black background. I 
> had
> expected the background to be of the same gray as used everywhere else
> in the fox window. Anyone know how to achieve this? I've tried various
> combinations of setting the options as in the commented-out line above,
> and using images without transparent background in .png and .gif 
> format.
> The result was that the background color that should have been
> transparent was actually displayed.

The problem, I think, is that the FXImageFrame widget isn't aware of 
icon transparency. That is, it assumes that whatever you're passing it 
is a "plain old" image, without a transparency mask.

I would recommend replacing the image frame with a label, and assigning 
your icon to that label, e.g.

	arrow_image = File.open("ArrowShortRightRedT.png", "rb") {|f|
		FXPNGIcon.new(app, f.read, 0, IMAGE_ALPHAGUESS)
	arrow = FXLabel.new(hframe, "", arrow_image)

Hope this helps,


More information about the fxruby-users mailing list