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

Home » Public Forums » archive » Re: OVERLAYING IMAGES
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: OVERLAYING IMAGES [message #24749 is a reply to message #24723] Thu, 12 April 2001 10:45 Go to previous message
Rick Towler is currently offline  Rick Towler
Messages: 821
Registered: August 1998
Senior Member
If you literally want to control the opacity of your plots (vs. doing
something with your data before contouring to fake it) you could try
something like this:


1.plot your contour. This could be done in object graphics, or direct.


2.draw the plot to a buffer, read the buffer and you'll get an image object.
If you plotted with direct graphics you'll read the device you plotted to to
get the image data, then create an image object with that data.


3.add a 4th (alpha) channel to the image object like so:

image -> GetProperty, data = imagedata
imagedims = size(imagedata)
newimage=make_array(imagedims[1]+1,imagedims[2],imagedims[3] , $
/byte, /nozero)
newimage[0:2,*,*] = imagedata
newimage[3,*,*] = 255 (see note below)
image -> SetProperty, data = newimage

the value you set the alpha channel to will determine the opacity. Your
range is 0 (completely translucent) to 255 (opaque).


4.repeat 1-3 for the second plot.


5.create two idlgrpolygon objects, one on top of the other, and texture map
your images on them.


6.by changing the alpha value of your image objects you can fade them in and
out.


If you are familiar with object graphics and have played around with the
polygon object and have done some texturing then this is fairly easy. If
not, plan to spend some time with the documentation. Everything is there,
you'll just have to experiment a little. Then encourage David to write this
Object Graphics book he has been threatening to write. Speaking of David, I
think he has a program demonstrating this alpha channel stuff on his web
site. I would check that out. It may even be a drop in solution.

-Rick Towler



"Mark Chan" <chanm@cadvision.com> wrote in message
news:9b38m8$f0f$1@news3.cadvision.com...
> 1) plot some contour, using contour fill
>
> 2) oplot it with a different contour fill
>
> You get: only (2) appears (the other has been covered).
>
> Is there a way to make (2) translucent so that one can see both images at
> the same time?
>
> Thanks,
> Mark
>
>
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: search for linux programs
Next Topic: Re: something like perl's 'require 5.4'

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

Current Time: Fri Oct 10 21:36:32 PDT 2025

Total time taken to generate the page: 1.91913 seconds