comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Transparency in Bitmap buttons
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Transparency in Bitmap buttons [message #26320] Wed, 15 August 2001 13:00
John-David T. Smith is currently offline  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
Re: Transparency in Bitmap buttons [message #26321 is a reply to message #26320] Wed, 15 August 2001 12:00 Go to previous message
Paul van Delst is currently offline  Paul van Delst
Messages: 364
Registered: March 1997
Senior Member
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?

IDL> print, !version
{ x86 linux unix 5.4.1 Jan 16 2001 32 32}

paulv

--
Paul van Delst A little learning is a dangerous thing;
CIMSS @ NOAA/NCEP Drink deep, or taste not the Pierian spring;
Ph: (301)763-8000 x7274 There shallow draughts intoxicate the brain,
Fax:(301)763-8545 And drinking largely sobers us again.
Alexander Pope.
Re: Transparency in Bitmap buttons [message #26322 is a reply to message #26321] Wed, 15 August 2001 10:07 Go to previous message
david[2] is currently offline  david[2]
Messages: 100
Registered: June 2001
Senior Member
JD Smith writes:

> 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?

Yes, nice tan background. Windows NT 4.0, IDL 5.4.

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Transparency in Bitmap buttons
Next Topic: limits to mosaic function in ENVI 3.2?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 14:56:12 PDT 2025

Total time taken to generate the page: 0.00367 seconds