logical_pen_extended


This class defines the style, width and color of a logical pen.

struct logical_pen_extended
{
  unsigned style;
  unsigned width;
  unsigned brush;
  color color;
  void* hatch;
  unsigned entries;
  unsigned array[1];

  unsigned& operator[](unsigned Index) {return array[Index];}
};
style The style of the graphics pen. This may be a combination of the values occurring in the enumeration pen_style.
width For geometric pens, the width of the pen in logical units. For cosmetic pens, the width must be 1.
brush The style of the brush.
color The color of the pen used by the brush.
hatch If brush is brush_style::pattern, hatch is a handle to the bitmap that defines the pattern. If brush is brush_style::solid or brush_style::hollow, hatch is ignored. If brush is brush_style::pattern_bitmap, hatch is a handle to a packed device independent bitmap. To obtain this handle, an application calls the function allocate_global_memory with global_memory_flag::moveable (or allocate_local_memory local_memory_flag::moveable) to allocate a block of memory and then fills the memory with the packed device independent bitmap. A packed DIB consists of a bitmap_information structure immediately followed by the array of bytes that define the pixels of the bitmap. If brush is brush_style::pattern_bitmap_pointer, hatch is a pointer to a packed DIB. The pointer derives from the memory block created by allocate_local_memory with local_memory_flag::fixed or by allocate_global_memory with global_memory_flag::fixed set, or it is the pointer returned by a call like lock_local_memory. A packed DIB consists of a bitmap_information structure immediately followed by the array of bytes that define the pixels of the bitmap. If brush is brush_style::hatched, hatch specifies the orientation of the lines used to create the hatch. It can be one of the following values.

Value Meaning
hatch_style::diagonal_back 45-degree upward hatch (left to right)
hatch_style::cross Horizontal and vertical crosshatch
hatch_style::diagonal_cross 45-degree crosshatch
hatch_style::diagonal_forward 45-degree downward hatch (left to right)
hatch_style::horizontal Horizontal hatch
hatch_style::vertical Vertical hatch

entries The number of entries in the style array.
array An array of custom styles for the brush.