An IDLgrClipboard object sends Object Graphics output to the operating system native clipboard or to a file in bitmap or vector format. The FILENAME, VECTOR, and POSTSCRIPT keyword values in the IDLgrClipboard::Draw method, and the platform on which the call is issued determine the file type and destination. See IDLgrClipboard::Draw for details.
Note: Objects or subclasses of this type can not be saved or restored.
Superclasses
IDLitComponent
Creation
See IDLgrClipboard::Init.
Properties
Objects of this class have the following properties. See IDLgrClipboard Properties for details on individual properties.
In addition, objects of this class inherit the properties of all superclasses of this class.
Methods
This class has the following methods:
In addition, this class inherits the methods of its superclasses (if any).
Examples
This example demonstrates the process of copying the contents of an IDL graphics display object (a buffer or a window) to the system clipboard, where it becomes available for pasting into another application. The example also uses the IDLgrClipboard::Draw method to create a platform-dependent file type in the current directory.
PRO SendingPlotToClipboard
signalFile = FILEPATH('damp_sn2.dat', $
SUBDIRECTORY = ['examples', 'data'])
signalSize = 512
signal = BYTARR(signalSize, /NOZERO)
OPENR, unit, signalFile, /GET_LUN
READU, unit, signal
FREE_LUN, unit
offsetScale = 150.
viewOffset = offsetScale*[-1., -1., 1., 1.]
signalRange = MAX(signal) - MIN(signal)
windowSize = [512, 384]
oWindow = OBJ_NEW('IDLgrWindow', RETAIN = 2, $
DIMENSIONS = windowSize, $
TITLE = 'Damped Sine Wave with Noise')
oViewgroup = OBJ_NEW('IDLgrViewgroup')
oWindow->SetProperty, GRAPHICS_TREE = oViewgroup
oContainer = OBJ_NEW('IDL_CONTAINER')
oViewgroup->Add, oContainer
oView = OBJ_NEW('IDLgrView', $
VIEWPLANE_RECT = [0., 0., signalSize, signalRange] + $
viewOffset)
oViewgroup->Add, oView
oModel = OBJ_NEW('IDLgrModel')
oView->Add, oModel
oPlot = OBJ_NEW('IDLgrPlot', signal, COLOR = [0, 0, 255])
oModel->Add, oPlot
oPlot->GetProperty, XRANGE = xPlotRange, $
YRANGE = yPlotRange
oXTitle = OBJ_NEW('IDLgrText', 'Time (seconds)')
oContainer->Add, oXTitle
oXAxis = OBJ_NEW('IDLgrAxis', 0, RANGE = xPlotRange, $
LOCATION = [xPlotRange[0], yPlotRange[0]], /EXACT, $
TITLE = oXTitle, TICKDIR = 0, $
TICKLEN = (0.02*(yPlotRange[1] - yPlotRange[0])))
oModel->Add, oXAxis
oYTitle = OBJ_NEW('IDLgrText', 'Amplitude (centimeters)')
oContainer->Add, oYTitle
oYAxis = OBJ_NEW('IDLgrAxis', 1, RANGE = yPlotRange, $
LOCATION = [xPlotRange[0], yPlotRange[0]], /EXACT, $
TITLE = oYTitle, TICKDIR = 0, $
TICKLEN = (0.02*(xPlotRange[1] - xPlotRange[0])))
oModel->Add, oYAxis
oModel->Translate, -50., -50., 0.
oWindow->Draw
oWindow->GetProperty, RESOLUTION = screenResolution
oClipboard = OBJ_NEW('IDLgrClipboard', QUALITY = 2, $
DIMENSIONS = windowSize, $
RESOLUTION = screenResolution, $
GRAPHICS_TREE = oViewgroup)
screenDevice = !D.NAME
CASE screenDevice OF
'X': fileExtension = '.ps'
'WIN': fileExtension = '.emf'
ELSE: BEGIN
OBJ_DESTROY, [oWindow, oClipboard]
RETURN
END
ENDCASE
clipboardFile = 'damp_sn2' + fileExtension
oClipboard->Draw, FILENAME = clipboardFile, $
/VECTOR
oClipboard->Draw, FILENAME = 'damp_sn2.eps', $
/POSTSCRIPT, /VECTOR
oClipboard->Draw, /VECTOR
oClipboard->SetProperty, GRAPHICS_TREE = OBJ_NEW()
OBJ_DESTROY, oClipboard
END
Version History
5.1 |
Introduced |
6.2 |
Added QueryRequiredTiles method
|
8.2 |
Added LINE_QUALITY property |