drawMode

Type: Integer

Availability: Read or write at run time only

The drawMode property of the Window class, together with the drawFontItalic, drawFontStrikethru, drawFontBold, drawFontName, and drawFontSize, and drawFontUnderline properties, determines the appearance of output from graphics methods on a form or control.

Use the drawMode property to produce visual effects when drawing with the graphics methods. Windows compares each pixel in the draw pattern to the corresponding pixel in the existing background, and then it applies bit-wise operations. For example, setting DrawMode_Xor (7) uses the Xor operator to combine a draw pattern pixel with a background pixel.

The exact effect of the drawMode property setting depends on the way the color of a line drawn at run time combines with colors already on the screen. Settings 1, 6, 7, 11, 13, and 16 yield perhaps the most-predictable results.

If you draw an object twice when the value is set to DrawMode_Xor (7), an object that is drawn twice has the original image restored. However, if the color black (0) is used for drawing, no image is drawn as the Xor operation results in the same color.

The settings of the drawMode property are listed in the following table.

Window Class Constant Value Description
DrawMode_Black 1 Black Pen.
DrawMode_Copy 13 Color specified by the foreColor property Copy Pen (the default value).
DrawMode_Invert 6 Inverse of the display color.
DrawMode_MaskPen 9 Combination of the colors common to both the pen and the display.
DrawMode_MaskNotPen 3 Combination of the colors common to the background color and the inverse of the pen.
DrawMode_MaskPenNot 5 Combination of the colors common to both the pen and the inverse of the display.
DrawMode_MergeNotPen 12 Combination of the display color and the inverse of the pen color.
DrawMode_MergePen 15 Combination of the pen color and the display color.
DrawMode_MergePenNot 14 Combination of the pen color and the inverse of the display color.
DrawMode_Nop 11 No operation, output remains unchanged. In effect, this setting turns drawing off.
DrawMode_NotCopyPen 4 Inverse of setting 13 (Copy Pen).
DrawMode_NotMaskPen 8 Inverse of setting 9 (Mask Pen).
DrawMode_NotMergePen 2 Inverse of setting 15 (Merge Pen).
DrawMode_NotXorPen 10 Inverse of setting 7 (Xor Pen).
DrawMode_White 16 White Pen.
DrawMode_Xor 7 Combination of the colors in the pen and in the display color, but not in both.