2.1.31 StockObject Enumeration

The StockObject enumeration specifies the indexes of predefined logical graphics objects that can be used in graphics operations.

The specific structures of stock objects are implementation-dependent; however, the properties of stock objects SHOULD be equivalent to the properties of explicitly created objects of the same type. These properties are specified where possible for the stock objects defined in this enumeration.

 typedef  enum 
 {
   WHITE_BRUSH = 0x80000000,
   LTGRAY_BRUSH = 0x80000001,
   GRAY_BRUSH = 0x80000002,
   DKGRAY_BRUSH = 0x80000003,
   BLACK_BRUSH = 0x80000004,
   NULL_BRUSH = 0x80000005,
   WHITE_PEN = 0x80000006,
   BLACK_PEN = 0x80000007,
   NULL_PEN = 0x80000008,
   OEM_FIXED_FONT = 0x8000000A,
   ANSI_FIXED_FONT = 0x8000000B,
   ANSI_VAR_FONT = 0x8000000C,
   SYSTEM_FONT = 0x8000000D,
   DEVICE_DEFAULT_FONT = 0x8000000E,
   DEFAULT_PALETTE = 0x8000000F,
   SYSTEM_FIXED_FONT = 0x80000010,
   DEFAULT_GUI_FONT = 0x80000011,
   DC_BRUSH = 0x80000012,
   DC_PEN = 0x80000013
 } StockObject;

WHITE_BRUSH:  A white, solid-color brush that is equivalent to a logical brush (LogBrushEx object, section 2.2.12) with the following properties:

LTGRAY_BRUSH:  A light gray, solid-color brush that is equivalent to a logical brush with the following properties:

  • BrushStyle: BS_SOLID

  • Color: 0x00C0C0C0

GRAY_BRUSH:  A gray, solid-color brush that is equivalent to a logical brush with the following properties:

  • BrushStyle: BS_SOLID

  • Color: 0x00808080

DKGRAY_BRUSH:  A dark gray, solid color brush that is equivalent to a logical brush with the following properties:

  • BrushStyle: BS_SOLID

  • Color: 0x00404040

BLACK_BRUSH:  A black, solid color brush that is equivalent to a logical brush with the following properties:

  • BrushStyle: BS_SOLID

  • Color: 0x00000000

NULL_BRUSH:  A null brush that is equivalent to a logical brush with the following properties:<43>

  • BrushStyle: BS_NULL

WHITE_PEN:  A white, solid-color pen that is equivalent to a logical pen (LogPen object, section 2.2.19) with the following properties:

  • PenStyle: PS_COSMETIC + PS_SOLID (PenStyle enumeration, section 2.1.25)

  • ColorRef: 0x00FFFFFF (WMF ColorRef object).

BLACK_PEN:  A black, solid-color pen that is equivalent to a logical pen with the following properties:

  • PenStyle: PS_COSMETIC + PS_SOLID

  • ColorRef: 0x00000000

NULL_PEN:  A null pen that is equivalent to a logical pen with the following properties:

  • PenStyle: PS_NULL

OEM_FIXED_FONT:  A fixed-width, OEM character set font that is equivalent to a logical font (LogFont object, section 2.2.13) with the following properties:

ANSI_FIXED_FONT:  A fixed-width font that is equivalent to a logical font with the following properties:<44>

  • Charset: ANSI_CHARSET

  • PitchAndFamily: FF_DONTCARE + FIXED_PITCH

ANSI_VAR_FONT:  A variable-width font that is equivalent to a logical font with the following properties:<45>

  • Charset: ANSI_CHARSET

  • PitchAndFamily: FF_DONTCARE + VARIABLE_PITCH

SYSTEM_FONT:  A font that is guaranteed to be available in the operating system. The actual font that is specified by this value is implementation-dependent.<46>

DEVICE_DEFAULT_FONT:  The default font that is provided by the graphics device driver for the current output device. The actual font that is specified by this value is implementation-dependent.<47>

DEFAULT_PALETTE:  The default palette that is defined for the current output device. The actual palette that is specified by this value is implementation-dependent.<48>

SYSTEM_FIXED_FONT:  A fixed-width font that is guaranteed to be available in the operating system. The actual font that is specified by this value is implementation-dependent.

DEFAULT_GUI_FONT:  The default font that is used for user interface objects such as menus and dialog boxes. The actual font that is specified by this value is implementation-dependent.<49>

DC_BRUSH:  The solid-color brush that is currently selected in the playback device context. The default SHOULD be WHITE_BRUSH.<50>

DC_PEN:  The solid-color pen that is currently selected in the playback device context. The default SHOULD be BLACK_PEN.<51>

During metafile processing, stock object indexes can be used by object manipulation records (section 2.3.8) to select objects into the playback device context in the same way as indexes of graphics objects that are explicitly created by object creation records (section 2.3.7). The index of a stock object can be distinguished from the index of an explicit object by the value of the most-significant bit. If that bit is set, the object is a stock object; if the bit is clear, the object was created by a previous metafile record.

Show: