Objects of the IDLgrClipboard class send Object Graphics output to the operating system native clipboard or to a file in bitmap or vector format. The file type and destination is dependent upon the platform and the values of Draw method keywords.
| Note |
The file type produced when the IDLgrClipboard::Draw method is passed an IDLgrView, IDLgrViewgroup, or IDLgrScene object varies depending upon keyword settings and the platform on which the call is issued. If the FILENAME keyword is set to a non-empty string, the name of the file IDL creates is specified by the string. If the FILENAME keyword is a non-zero, numeric value, IDL creates a file named idl.ext where ext is replaced with the appropriate extension shown in parentheses in the following table.
| Note |
Objects can be written to the operating system clipboard using IDLgrClipboard::Draw. When the FILENAME keyword equals an empty string (" "), equals 0 (zero), or is not specified, the output is written to the clipboard.
| Note |
The IDLgrClipboard::Init method takes no arguments. Use the following statement to create a clipboard object that represents the system-native clipboard buffer:
myClipboard = OBJ_NEW('IDLgrClipboard')
The following code creates an IDLgrClipboard object and outputs the contents of an IDLgrView, IDLgrViewgroup, or IDLgrScene to various files based on the platform. This is useful to determine exactly how the contents of the window are translated into bitmap or vector graphics. In the following code, myview denotes the name of the object (view, viewgroup, or scene) to be output. Vector postscript output is also generated using the CMYK color model.
oClip = OBJ_NEW('IDLgrClipboard')
; Create Windows-only output file types.
if !VERSION.OS_FAMILY eq 'Windows' then begin
oClip->Draw, myview, VECTOR=0, POSTSCRIPT=0, $
FILENAME="clipboard.bmp"
oClip->Draw, myview, VECTOR=1, POSTSCRIPT=0, $
FILENAME="clipboard.emf"
endif
; Create bitmap and vector PostScript files.
oClip->Draw, myview, VECTOR=0, POSTSCRIPT=1, $
FILENAME="clipboard_bitmap.eps"
oClip->Draw, myview, VECTOR=1, POSTSCRIPT=1, $
FILENAME="clipboard_vector.eps"
oClip->Draw, myview, VECTOR=1, POSTSCRIPT=1, $
/CMYK, FILENAME="clipboard_cmyk.eps"
obj_destroy, oClip
See IDLgrClipboard for details.