Re: Transparency in Bitmap buttons [message #26320] |
Wed, 15 August 2001 13:00  |
John-David T. Smith
Messages: 384 Registered: January 2000
|
Senior Member |
|
|
Paul van Delst wrote:
>
> JD Smith wrote:
>>
>> Has anyone had luck using the transparency feature of color-bitmap
>> buttons?
>>
>> The manual quotes:
>>
>>>> >>>>>>>>>>>>>>
>> Transparent Bitmaps
>>
>> For 16- and 256-color bitmaps, IDL uses the color of the pixel in the
>> lower left corner as the transparent color. All pixels of this color
>> become transparent, allowing the button color to show through. This
>> allows you to use bitmaps that are not rectangular. If you have a
>> rectangular bitmap that you want to use as a button label, you must
>> either draw a border of a different color around the bitmap or save the
>> bitmap as 24-bit (TrueColor). If your bitmap also contains text, make
>> sure the border you draw is a different color than the text, otherwise
>> the text color will become transparent.
>> <<<<<<<<<<<<<<<<<
>>
>> But I'm unable to see this behavior.
>>
>> Try:
>>
>> IDL> base=widget_base(/COLUMN)
>> IDL> but=widget_button(base,VALUE=filepath('zoom.bmp',$
>> SUBDIR=['resource','bitmaps']),/BITMAP)
>> IDL> widget_control, base, /realize
>>
>> Does the button blend into the background tranparently? On my system
>> (x86 linux unix 5.4), it does not, despite this claim. Note that if you
>> have a matching gray background it may appear to blend in (though
>> without real transparency). Please note your system and version if
>> responding.
>
> Ummm, I couldn't really tell what I was supposed to see so I attached a gif of the result
> (JD_button.gif). Background was gray. Button was gray. Is this a case of "appearing" to
> blend in?
>
Quite likely. That's the look I'm after, though. You can change your
widget background color and give it another try by throwing something
like:
Idl*background: pink
into your .Xdefaults (don't forget xrdb -merge .Xdefaults). How lovely.
JD
|
|
|