[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


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

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