[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Plot into an array



Dominik Paul writes:

> does somebody know, how I can plot a function into an array, not into a
> window? Or can I get the array of the image of a window for saving as a jpeg
> or gif?

Write into a pixmap window (a window in memory):

   Window, /Pixmap, /Free
   Plot, myfunction
   array = TVRD() ; or TVRD(True=1) on 24-bit display

Or, write into the Z-graphic buffer, if you want
to be assured of having a 2D array:

   thisDevice = !D.Name
   Set_Plot, 'Z'
   Plot, myfunction
   array = TVRD()
   Set_Plot, thisDevice

> Or can I get the array of the image of a window for saving as a jpeg
> or gif?

If you don't want to worry about what kind
of device you are on and what keyword to use
with TVRD, and you want to write JPEG, TIFF, 
PNG, GIF, etc files directly (you write JPEG 
and GIF files in two completely different ways, 
depending upon the type of device you are using), 
get ahold of my TVRead program. It takes
care of all these details for you:

   http://www.dfanning.com/programs/tvread.pro

Then you can use either a pixmap or the Z-buffer and 
just do something like this:

   array = TVRead(/JPEG)

To read the image from the display and create the
output file directly.

Cheers,

David

-- 
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155