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

Home » Public Forums » archive » Write_png problem
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Write_png problem [message #89810] Thu, 04 December 2014 06:37 Go to next message
Sarah Douglas is currently offline  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 Go to previous messageGo to next message
Helder Marchetto is currently offline  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
Re: Write_png problem [message #89814 is a reply to message #89812] Thu, 04 December 2014 07:08 Go to previous message
Sarah Douglas is currently offline  Sarah Douglas
Messages: 3
Registered: December 2014
Junior Member
Yes that worked!

Thank you so much!
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: 3D matrix
Next Topic: Bug report: Draw window resolution

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

Current Time: Wed Oct 08 15:06:54 PDT 2025

Total time taken to generate the page: 0.00498 seconds