Re: Alpha Blending inside of Widgets / Graphic Objects in Widgets [message #33859 is a reply to message #33850] |
Thu, 30 January 2003 09:54  |
Rick Towler
Messages: 821 Registered: August 1998
|
Senior Member |
|
|
"Kay Bente" wrote
> I would like to know, if it�s possible to put an Image Object inside a
> normal widget (instead of a Widget_Draw).
Well, yes and no. Widget_Draw is a widget and it seems quite normal to me
;)
I don't really understand what you are trying to do but I'll venture a guess
that you would like to place an image in your widget that appears to be part
of the widget base? For example, if I select Help->About IDL in IDLDE I get
a dialog with the IDL logo in the upper left corner. Upon inspection you'll
notice that the logo isn't square (because of the shadow). The only way to
do this would be to set the background color of your draw widget to the
color of your widget base then draw your image. The image will look as if
it is drawn directly in the base.
Finding the color of the widget base is the trick.
AFAIK there is no platform independent way to do this so any solution will
be limited. I have done this on Windows machines using the GetSysColor
function (delcared in winuser.h, link to user32.lib). It works like a charm
and there is no better way to distrat your users from the limitations of
your program than by putting up a flashy interface. :)
> p.s. Does someone know, if it�s possible to read and play .mp3 files?
You better start polishing your C skills as there is no built in function
for this in IDL.
You could read the compressed data using IDL. I'm sure the file format is
available on the web. With the compressed data in hand, you would need to
decompress it. This might not be that difficult. Find a few MP3 players
and look at the .dll (or .so) libraries they ship with. Chances are you
would be able to use IDL's CALL_EXTERNAL function to access the
decompression algorithm (you'll just need to find the entry point). For
short clips, you could decompress a section of the file and use IDL's
WRITE_WAV to create an uncompressed .wav file. Since IDL doesn't do much
more than ring it's bell, the easiest way to play the file would be to use
SPAWN to call an appropriate program. Extra credit would be given for using
Randall Frank's IDL_Tools .dlm package which includes an interface for
playing sound.
Now that sounds like a project.
-Rick
|
|
|