Routines (alphabetical) > Object Classes > Graphics Object Classes > IDLgrPrinter::Draw

# IDLgrPrinter::Draw

Syntax | Arguments | Keywords | Version History

The IDLgrPrinter::Draw procedure method draws the given picture to this graphics destination.

### Printing in Bitmap or Vector Graphic Mode

The IDLgrPrinter::Draw method VECTOR keyword generates output in bitmap or vector format. The following table shows the keyword options and results for each platform.

Keyword Settings | Windows Printer Output | UNIX File Type
VECTOR = 0 | Bitmap (BMP) | Encapsulated PostScript (EPS) file (e.g. `xprinter.eps`)
VECTOR = 1 | Enhanced MetaFile (EMF) (EMF is a Windows-only format) | Encapsulated PostScript (EPS) file (e.g.`xprinter.eps`)

Because Windows printer output is usually sent directly to the printer, EMF and BMP files are not viewable. On UNIX, the printer output is usually directed to a file named `xprinter.eps` by default.

Note: Objects are drawn to the destination device in the order that they are added to the model, view, viewgroup, or scene object that contains them when VECT_SORTING=0. Otherwise, objects are drawn to the destination device based on their average depth value.

## Syntax

Obj->[IDLgrPrinter::]Draw [, Picture] [, VECT_SORTING={ 0 | 1 } ] [, VECT_TEXT_RENDER_METHOD={ 0 | 1 } ] [, VECTOR={ 0 | 1 } ]

## Arguments

### Picture

The view (an instance of an IDLgrView object), viewgroup (an instance of an IDLgrViewgroup object), or scene (an instance of an IDLgrScene object) to be drawn.

## Keywords

### VECT_SORTING

This keyword has an effect only when generating vector output (VECTOR=1).

This keyword controls the way object primitives in a picture appear in the destination. Valid values are:

- 0 = disable sorting. This causes the object primitives to appear in the vector output file in the same order they are drawn on the display device. This is the order in which they appear in the graphics tree.
- 1 = enable sorting (default). Objects are ordered from back to front based on each primitive object’s average depth value.

Note: Objects that intersect each other, IDLgrImage objects (which do not update the depth buffer), and objects contained within transparent views may not sort correctly.

### VECT_TEXT_RENDER_METHOD

This keyword has an effect only when generating vector output (VECTOR=1).

This keyword controls the way text is rendered in a vector graphic file. Valid values are:

- 0 = render text as text primitives (default). Use the output device’s text primitives when rendering text.
- 1 = render text as primitives composed of triangles. Render text in the vector file as a series of filled triangles. This produces text that closely matches the text on the display device, but the output file size is larger.

Note: When using the IDLgrPrinter object under UNIX, the Xprinter output is regarded as write-only. As there is no support for 3-D text, IDL always generates filled triangles when rendering text in the Xprinter output. On Windows, the vector output is always Enhanced MetaFile (EMF) file format. Because printer output is usually sent directly to the printer the EMF file cannot be seen by the user.

### VECTOR

Set this keyword to indicate the type of graphics primitives generated. Valid values are:

- 0 = generate bitmap graphics (default). Render the scene to a buffer and then copy the buffer to the printer in bitmap format. The bitmap retains the quality of the original image.
- 1 = generate vector graphics. Render the scene using simple vector operations that result in a representation of the scene that is scalable to the printer. The vector representation, which is sent to the printer, does not retain all the attributes of the original image.

Note: Transparent objects in a view are not rendered in vector graphic files. Semi-transparent objects are rendered fully opaque.

## Version History

5.0 | Introduced
6.1 | Added VECT_SORTING, VECT_TEXT_RENDER_METHOD keywords