Re: Missing value and Image size in Image, Function Graphic [message #87097 is a reply to message #87095] |
Tue, 07 January 2014 08:22   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Gompie writes:
> Following your advice on AlphaBackgroundImage, I tried with the following commands.
>
> set_plot, 'ps'
> !p.font=0
> device, filename='fig_better.ps', encapsulated=1, /helvetica
>
> cgImage, cgDemoData(7), CTIndex=0, XRange=[0,500], YRange=[0,500], Margin=0.1,outfile='test.png',output='png', /Save
>
> cgImage, cgDemoData(5),AlphaBackgroundImage='test.png', CTIndex=33, Transparent=30, XRange=[50,250], YRange=[250,450], /Overplot
>
> But get the error unexpected dimensions of background Image. I tried with different formats (gif ps etc) of Alphaimage but got the same message.
Well, uh, the parameter you are passing needs to be an *image*, not the
name of a file containing an image. :-)
Generally, you would get the background image like this, before you set
up the PostScript device:
backgroundImage = cgSnapshot()
ps_open, 'test.png'
cgimage, ...., AlphaBackgroundImage = backgroundImage
ps_close
You can find other examples in the Coyote Plot Gallery:
http://www.idlcoyote.com/gallery/index.html#MULTIPSTRANSPARE NT
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.")
|
|
|