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

Home » Public Forums » archive » Transparent series of images with axis using cgImage
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: Transparent series of images with axis using cgImage [message #88120 is a reply to message #88118] Fri, 21 March 2014 09:41 Go to previous message
Petros Syntelis is currently offline  Petros Syntelis
Messages: 32
Registered: June 2013
Member
Thx David!
I'll study your example to sort it out!

Cheers,
Petros

On Friday, March 21, 2014 2:41:35 PM UTC, David Fanning wrote:
> Petros Syntelis writes:
>
>
>
>> Has anybody tried to create transparent images with axis and done it correctly?
>
>
>
> Not this way, no. :-)
>
>
>
> Too much going on here for the hacking that has to take place in direct
>
> graphics. I would do this a completely different way. I would write the
>
> program like this:
>
>
>
> ;****************************************************
>
> PRO Example, PS=ps
>
>
>
> ; Fake images.
>
> im1 = cgDemoData(7)
>
> im2 = cgDemoData(21)
>
> im3 = cgDemoData(22)
>
> im4 = cgDemoData(5)
>
>
>
> ; Build composite images.
>
> cgDisplay, 400, 500, WID=2, /Pixmap
>
> cgimage, im1
>
> cgimage, im4, ctindex=33, $
>
> AlphaFGPos=[0.0,0.25,1.0,0.75], transparent=50
>
> snap1 = cgSnapShot()
>
>
>
> cgimage, im2
>
> cgimage, im4, ctindex=33, $
>
> AlphaFGPos=[0.0, 0.25, 1.0, 0.75], transparent=50
>
> snap2 = cgSnapShot()
>
>
>
> cgimage, im3
>
> cgimage, im4, ctindex=33, $
>
> AlphaFGPos=[0.0, 0.25, 1.0, 0.75], transparent=50
>
> snap3 = cgSnapShot()
>
>
>
> ; Delete the Pixmap.
>
> WDelete, 2
>
>
>
> ; Set multimargin and character size values.
>
> mm = 12
>
> cs = 2.25
>
>
>
> ; Need a PostScript file?
>
> IF Keyword_Set(ps) THEN BEGIN
>
> cgPS_Open, 'example.ps'
>
> mm = 8
>
> cs = 1.75
>
> ENDIF
>
>
>
> ; Display them.
>
> cgDisplay, 1200, 500
>
>
>
> !P.Multi=[0,3,1]
>
> cgimage, snap1, multimargin=mm, /axes, $
>
> OPosition=opos, axkey={charsize:cs}
>
> yrange = opos[3] - opos[1]
>
> p1 = opos[1] + yrange*0.25
>
> p3 = opos[3] - yrange*0.25
>
> cgPlot, [1], /NoData, /NoErase, Charsize=cs, $
>
> Position=[opos[0], p1, opos[2], p3], AxisColor='red'
>
>
>
> cgimage, snap2, multimargin=mm, /axes, $
>
> OPosition=opos, axkey={charsize:cs}
>
> yrange = opos[3] - opos[1]
>
> p1 = opos[1] + yrange*0.25
>
> p3 = opos[3] - yrange*0.25
>
> cgPlot, [1], /NoData, /NoErase, Charsize=cs, $
>
> Position=[opos[0], p1, opos[2], p3], AxisColor='red'
>
>
>
> cgimage, snap3, multimargin=mm, /axes, OPosition=opos, $
>
> axkey={charsize:cs}
>
> yrange = opos[3] - opos[1]
>
> p1 = opos[1] + yrange*0.25
>
> p3 = opos[3] - yrange*0.25
>
> cgPlot, [1], /NoData, /NoErase, Charsize=cs, $
>
> Position=[opos[0], p1, opos[2], p3], AxisColor='red'
>
>
>
> !P.Multi=0
>
>
>
> IF Keyword_Set(PS) THEN BEGIN
>
> cgPS_Close, /PNG
>
> ENDIF
>
>
>
> END
>
> ;****************************************************
>
>
>
> To see it on the display:
>
>
>
> IDL> Example
>
>
>
> To see it in a PostScript and PNG file:
>
>
>
> IDL> Example, /PS
>
>
>
> Cheers,
>
>
>
> David
>
>
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
>
> Sepore ma de ni thue. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: how to convert a segmented image to _polygons_ and save it in a single ROI or .evf file?
Next Topic: Killing Widget Objects

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

Current Time: Fri Oct 10 06:18:01 PDT 2025

Total time taken to generate the page: 3.36096 seconds