Write_png problem [message #89810] |
Thu, 04 December 2014 06:37  |
Sarah Douglas
Messages: 3 Registered: December 2014
|
Junior Member |
|
|
Hi, i am having some problems with the write_png procedure.
I am trying to save a large image as a png. I am currently displaying the image using "tvscl" and then write_png.
However, this image has more rows than the size of my screen and when I write_png, it only writes the rows which can be seen on the screen, hence my image has a missing portion.
I have tried using "device, retain=2", but this has not helped this problem.
Thanks!
|
|
|
Re: Write_png problem [message #89812 is a reply to message #89810] |
Thu, 04 December 2014 06:53   |
Helder Marchetto
Messages: 520 Registered: November 2011
|
Senior Member |
|
|
On Thursday, December 4, 2014 3:37:05 PM UTC+1, Sarah Douglas wrote:
> Hi, i am having some problems with the write_png procedure.
>
> I am trying to save a large image as a png. I am currently displaying the image using "tvscl" and then write_png.
>
> However, this image has more rows than the size of my screen and when I write_png, it only writes the rows which can be seen on the screen, hence my image has a missing portion.
>
> I have tried using "device, retain=2", but this has not helped this problem.
>
> Thanks!
Hi,
I think your problem is not the write_png. Are you taking a snapshot of the window and then writing to the png? Could this be the case?
If so, try to write to a pixmap.
Here is how I did it:
IDL> window, xsize=3000, ysize=3000, /pixmap
IDL> w = !d.window
IDL> tvscl, dist(3000)
IDL> var = cgsnapshot()
IDL> help, var
VAR BYTE = Array[3, 3000, 3000]
IDL> write_png, 'test.png', var
Hope it helps.
Cheers,
Helder
|
|
|
|