DRAWMODE


typedef struct tagDRAWMODE {
  short    Rop2;           // see below
  short    bkMode;         // see below
  unsigned long  bkColor;        // see below
  unsigned long  TextColor;      // see below
  short    TBreakExtra;    // see below
  short    BreakExtra;     // see below
  short    BreakErr;       // see below
  short    BreakRem;       // see below
  short    BreakCount;     // see below
  short    CharExtra;      // see below
  unsigned long  LbkColor;       // see below
  unsigned long  LTextColor;     // see below
  DWORD    ICMCXform;      // see below
  short    StretchBltMode; // see below
  DWORD    eMiterLimit;    // see below
} DRAWMODE;

Contains information used to draw lines, fill interiors, and write text.

Rop2

Binary-raster operation value. The value, in the range 1 to 16, determines how to combine source and destination colors. Can be one of these values:

R2_BLACK (1)

Black: 0.

R2_NOTMERGEPEN (2)

Inverse of the bitwise OR of the source and destination colors: NOT (Source OR Dest).

R2_MASKNOTPEN (3)

Bitwise AND of the destination and the inverse of the source: Dest AND (NOT Source).

R2_NOTCOPYPEN (4)

Inverse of the source color: NOT Source.

R2_MASKPENNOT (5)

Bitwise AND of the source and the inverse of the destination: Source AND (NOT Dest).

R2_NOT (6)

Inverse of the destination color: NOT Dest.

R2_XORPEN (7)

Bitwise exclusive OR of the destination and source: Dest XOR Source.

R2_NOTMASKPEN (8)

Inverse of the bitwise AND of the destination and source colors: NOT (Dest AND Source).

R2_MASKPEN 9

Bitwise AND of the destination and source colors: Dest AND Source.

R2_NOTXORPEN (10)

Inverse of the bitwise exclusive OR of the destination and source colors: NOT (Dest XOR Source).

R2_NOP 11

Destination color: Dest.

R2_MERGENOTPEN (12)

Bitwise OR of the destination and the inverse of the source: Dest AND (NOT Source).

R2_COPYPEN (13)

Source color: Source.

R2_MERGEPENNOT (14)

Bitwise OR of the source and the inverse of the destination: Source OR (NOT Dest).

R2_MERGEPEN (15)

Bitwise OR of the source and the destination: Source OR Dest.

R2_WHITE (16)

White: 1.


bkMode

Background mode for styled lines, hatched brushes, brushes used for interiors and scan lines, bitmaps, and text. This member can be one of the following values:

BKMODE_TRANSPARENT (1) Also defined as TRANSPARENT

Leaves destination background unchanged.

BKMODE_OPAQUE (2) Also defined as OPAQUE

Replaces destination background with the color specified by the bkColor member.

BKMODE_LEVEL1 (3)

Use level 1 transparent anti-aliasing. A 1 in the glyph bitmap means that the display driver should blend the color specified in the TextColor member with the current pixel's color. Level 1 is a 25% blend. The blend should be done on the brightness, not the RGB values, and so it must be gamma-corrected.

BKMODE_LEVEL2 (4)

Use level 2 transparent anti-aliasing. A 1 in the glyph bitmap means that the display driver should blend the color specified in the TextColor member with the current pixel's color. Level 2 is a 50% blend. The blend should be done on the brightness, not the RGB values, and so it must be gamma-corrected.

BKMODE_LEVEL3 (5)

Use level 3 transparent anti-aliasing. A 1 in the glyph bitmap means that the display driver should blend the color specified in the TextColor member with the current pixel's color. Level 3 is a 75% blend. The blend should be done on the brightness, not the RGB values, and so it must be gamma-corrected.

BKMODE_TRANSLATE (6)

For 8bpp palettized surfaces only. The TextColor member is a far pointer to a byte array that is used to translate the existing pixel to a new pixel value. Use the current pixel byte as an index into the table to get the pixel's new value.


bkColor

Physical color value that specifies the background color.

TextColor

Physical color value that specifies the text (foreground) color.

TBreakExtra

Total amount of space, in pixels, to add to the break characters in a line of text. TBreakExtra is set to zero if no justification is required.

BreakExtra

Amount of space, in pixels, to add to each break character in a line of text. This value is equal to TBreakExtra divided by BreakCount.

BreakErr

Running error term: the amount of space, in pixels, not yet added to break characters in a line of text. This member is used in conjunction with the BreakRem member to determine which break characters receive the additional pixels specified by BreakRem. Initially, BreakErr is set to (BreakCount/2)+1.

BreakRem

Amount of space, in pixels, to add to one or more break characters in a line of text. This space is in addition to any extra space specified by the BreakExtra member and is intended to be distributed evenly across the line. The BreakRem value is equal to the remainder after dividing TBreakExtra by BreakCount.

BreakCount

Number of break characters in a line of text. If the TBreakExtra member is not zero, each break character must be drawn wider than its normal width. The BreakExtra member specifies the extra width, in pixels,. The BreakRem member may also specify additional pixels for one or more break characters.

CharExtra

Amount of space, in pixels, to add between characters in a line of text.

LbkColor

A COLORREF value that specifies the logical background color.

LTextColor

A COLORREF value that specifies the logical text (foreground) color.

ICMCXform

Transformation for image color matching. A color transform links an input color space to the device output color space. This field is used by drivers whenever a DIB is to be processed from GDI to the device, as in SetDIBitsToDevice, SetDIBits, and any other similar DIB function calls.

StretchBltMode

StretchBlt mode value. Can be one of the following values:

Value

Meaning

STRETCH_ANDSCANS (1)

Uses the AND operator to combine eliminated lines with the remaining lines. This mode preserves black pixels at the expense of colored or white pixels. It is the default mode. Also defined as SBM_BLACKONWHITE.

STRETCH_ORSCANS (2)

Uses the OR operator to combine eliminated lines with the remaining lines. This mode preserves colored or white pixels at the expense of black pixels. Also defined as SBM_WHITEONBLACK.

STRETCH_DELETESCANS (3)

Deletes the eliminated lines. Information in the eliminated lines is not preserved. Also defined as SBM_COLORONCOLOR.

STRETCH_HALFTONE (4)

Maps pixels from the source rectangle into blocks of pixels in the destination rectangle. The average color over the destination block of pixels approximates the color of the source pixels. Also defined as SBM_HALFTONE.


eMiterLimit

Miter limit value. The miter length is defined as the distance from the intersection of the line walls on the inside of the join to the intersection of the line walls on the outside of the join. The miter limit is the maximum allowed ratio of the miter length to the line width.

See also Output