[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: OVERLAYING IMAGES
The point of my post was that you can't do it "directly" in direct graphics.
You have to either manipulate your data to fake a sort of transparency or
you have to use object graphics to display the output.
Your best bet is to look into David Fanning's example program "Image_Blend"
found near the bottom of this page:
90% of the code you need would be in there. Then, with my pointers, you
should be able to quickly code the rest. His code is top notch. Easy to
read, and well commented.
"Mark Chan" <email@example.com> wrote in message
> I have been avoiding object graphic so far.
> I am interested in the real way, not the fake way.
> Will you, or know where I can find some direct graphic example code of
> Mark Chan
> "Rick Towler" <firstname.lastname@example.org> wrote in message
> > 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
> > If you plotted with direct graphics you'll read the device you plotted
> > 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,imagedims,imagedims, $
> > /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.
> > 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
> > your images on them.
> > 6.by changing the alpha value of your image objects you can fade them in
> > 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.
> > not, plan to spend some time with the documentation. Everything is
> > you'll just have to experiment a little. Then encourage David to write
> > Object Graphics book he has been threatening to write. Speaking of
> > 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" <email@example.com> wrote in message
> > firstname.lastname@example.org">news:email@example.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
> > > the same time?
> > >
> > > Thanks,
> > > Mark
> > >
> > >