[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:
http://www.dfanning.com/documents/programs.html
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.
Good Luck!
-Rick
"Mark Chan" <chanm@cadvision.com> wrote in message
9b7ksn$c9$1@news3.cadvision.com">news:9b7ksn$c9$1@news3.cadvision.com...
> Rick,
>
> 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
this
> nature?
>
> Thanks,
> Mark Chan
>
> "Rick Towler" <rtowler@u.washington.edu> wrote in message
> AQlB6.8137$%o2.664880@news1.sttls1.wa.home.com">news:AQlB6.8137$%o2.664880@news1.sttls1.wa.home.com...
> > 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
> > 9b38m8$f0f$1@news3.cadvision.com">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
> > >
> > >
> >
> >
>
>