OutputDocument.PasteGraphic

Prototypes

void PasteGraphic( int nGraphicType )

Parameters

int nGraphicType
A predefined constant that specifies the type of graphic you want pasted into the LISTING output document. The valid values are GRAPHICTYPE_DIB, GRAPHICTYPE_WMF, and GRAPHICTYPE_EMF.

Remarks

This method pastes a graphic from the Windows clipboard into the LISTING output document. This method is intended for pasting graphics from R, although it can be used to paste graphics from other sources as well.

The parameter nGraphicType determines the type of graphic pasted into the LISTING output document. The various graphic types are as follows:

GRAPHICTYPE_DIB
Pastes the graphic as a Windows Device Independent Bitmap.

GRAPHICTYPE_WMF
Pastes the graphic as a Windows Metafile.

GRAPHICTYPE_EMF
Pastes the graphic as a Windows Enhanced Metafile.

IMPORTANT: There are serious limitations that apply when you paste an EMF graphic into a LISTING output document. For a description of these limitations, please refer to the section Windows Enhanced Metafile Format in the topic Graphics File Formats. If you only intend to view the LISTING output document on the screen and do not intend to save the LISTING output document in an RTF file, you should use the EMF format.

Refer to the topic Graphics File Formats for additional information about these different types of graphics.

The Windows clipboard must contain data for the specified type of graphic.

Example
/* This example requires R to be installed on this PC. */

/* Create a hidden plot in R and copy it to the clipboard */
submit / R;
win.metafile( filename="", 5, 4, 10 )
x <- 1:5
plot(x)
# assigning dev.off() to a variable prevents a message
ignore <- dev.off()
endsubmit;

OutputDocument.GetDefault().PasteGraphic( GRAPHICTYPE_WMF );
See Also

R.CopyCurrentPlotToOutputDocument