.\
cgdisplay.pro
top cgDisplay
Graphics
cgDisplay [, pxsize] [, pysize], ASPECT=ASPECT [, COLOR=string/integer] [, /FREE] [, /FORCE] [, /MATCH] [, WID=integer] [, WINDOW=integer] [, XSIZE=integer] [, YSIZE=integer] [, _EXTRA=any]
The purpose of cgDisplay is to open a graphics window on the display, or in the PostScript device, or in the Z-graphics buffer, depending upon the current graphics device. In PostScript a window of the proper aspect ratio is created with PSWindow. Using cgDisplay to open "windows" will allow you to more easily write device-independent IDL programs.
Parameters
- pxsize in optional type=integer default=640
The X size of the graphics window created. By default, 640.
- pysize in optional type=integer default=512
The Y size of the graphics window created. By default, 512.
Keywords
- ASPECT
Set this keyword to create a window with this aspect ratio (ysize/xsize). If aspect is greater than 1, then the ysize will be used in the aspect ratio calculation. If the aspect is less than or equal to 1, then the xsize will be used in the aspect ratio calculation of the final window size. If the input to the ASPECT keyword is an image, then the aspect ratio will be calculated from the image itself.
- COLOR in optional type=string/integer default=white
If this keyword is a string, the name of the data color. By default, 'white'. Color names are those used with cgColor. Otherwise, the keyword is assumed to be a color index into the current color table. The color is not used if the "window" is opened in PostScript on the Z-graphics buffer.
- FREE in optional type=boolean default=0
Set this keyword to open a window with a free or unused window index number. This keyword applied only to graphics windows created on the computer display.
- FORCE in optional type=boolean default=0
Because of the way cgDisplay is designed to work in many devices and in resizeable graphics windows, it is sometimes the case that it won't create a window for you. If you set this keyword, a graphics window will be created while in any device that supports graphics windows.
- MATCH in optional type=boolean default=0
If this keyword is set, the new display window will match the size of the current display window, if there is one.
- WID in optional type=integer default=0
The window index number of the IDL graphics window to create.
- WINDOW in optional type=integer default=0
Because I want to use cgDisplay everywhere, including in resizeable graphics windows, and I don't want it opening windows then, it first checks to be sure there are no resizeable graphics windows on the display before it creates a window. Setting this keyword will overrule this check and create a normal IDL graphics window on the display. This will allow you to open a normal graphics window at the same time a resizeable graphics window exists on the display.
- XSIZE in optional type=integer default=640
The X size of the graphics window created. By default, 640. The PXSIZE parameter is used in preference to the XSIZE keyword value.
- YSIZE in optional type=integer default=512
The Y size of the graphics window created. By default, 512. The PYSIZE parameter is used in preference to the YSIZE keyword value.
- _EXTRA in optional type=any
Any keywords supported by the WINDOW command are allowed.
Examples
Use like the IDL WINDOW command:
IDL> cgDisplay, XSIZE=500 YSIZE=400
IDL> cgDisplay, 500, 500, WID=1, COLOR='gray'
Author information
- Author:
FANNING SOFTWARE CONSULTING:
David W. Fanning 1645 Sheely Drive Fort Collins, CO 80526 USA Phone: 970-221-0438 E-mail: david@idlcoyote.com Coyote's Guide to IDL Programming: http://www.idlcoyote.com- Copyright:
Copyright (c) 2010-2012, Fanning Software Consulting, Inc.
- History:
Change History:
Written, 15 November 2010. DWF. Changes so that color variables don't change type. 23 Nov 2010. DWF. Moved the window index argument to the WID keyword. 9 Dec 2010. DWF. Modified to produce a window in PostScript and the Z-buffer, too. 15 Dec 2010. DWF. Added the FREE keyword. 3 January 2011. DWF. I made a change that allows you to call cgDisplay inside a program that is going to be added to a cgWindow. The program will not open a graphics window if the current graphics window ID is found in a list of cgWindow window IDs. It is now possible to use cgDisplay in any graphics program, even those that will be run in cgWindow. 17 Nov 2011. DWF. Added ASPECT keyword. 18 Nov 2011. DWF. Allowed the window ASPECT to be set with an image argument. 25 Nov 2011. DWF. Now use Scope_Level to always create a display when cgDisplay is called from the main IDL level. 7 Feb 2012. DWF. Added FORCE and MATCH keywords. 16 Feb 2012. DWF.
File attributes
| Modification date: | Thu Feb 16 10:45:54 2012 |
| Lines: | 246 |
| Docformat: | rst rst |