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

Home » Public Forums » archive » Re: Alpha Blending inside of Widgets / Graphic Objects in Widgets
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Alpha Blending inside of Widgets / Graphic Objects in Widgets [message #33843 is a reply to message #33841] Fri, 31 January 2003 09:09 Go to previous messageGo to previous message
Rick Towler is currently offline  Rick Towler
Messages: 821
Registered: August 1998
Senior Member
"Kay Bente" wrote

> for the first part of your answer, I think you misunderstood me, i was
> thinking about to put an IDLgrImage or IDLgrWindow, or what ever of these
> objects i need (i don�t like objects) inside a Widget_Base, to display an
> image fusion.

Ahh, I see. So you want to use alpha blending to display 2 or more images
simultaneously. This can be done a number of ways, with or without objects.
Don't be afraid of the objects, they're really quite nice once you get to
know them.

At the full object end of the spectrum you can create two IDLgrImage objects
(with alpha channels) and display them, one on top of the other, in an
IDLgrWindow. Modulating image alpha will change the amount of fusion
between the two. David Fanning has written a fine program which does just
this called image_blend and it is available on his website
(www.dfanning.com)

Another option would be to create your two IDLgrImage objects and render to
an instance of IDLgrBuffer, then Read the buffer to get your fused image.
This wouldn't save you much over the first example.


The completely object free way would be to do it all by hand. The
"traditional" alpha blending equation is given in the docs to IDLgrImage and
it is something like:

result = ALPHA * srcPixel + ( 1 - ALPHA ) * destPixel

where

ALPHA - ranges from 0.0 to 1.0
result - Is the alpha blended color
srcPixel - Is the foreground pixel
destPixel- Is the background pixel

with an alpha of 0.0 the result will be the background pixel and with an
alpha of 1.0 the result will be the foreground pixel.

Use this equation on your R,G,B components of your image to calculate your
fused image.

Hope this helps.

-Rick
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: formatting array output?
Next Topic: How to eliminate trailing zeros in a string?

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

Current Time: Fri Oct 10 06:49:10 PDT 2025

Total time taken to generate the page: 0.31782 seconds