lcPaint_PenCreate Home

Creates a pen used to draw lines in a graphics window.

 HANDLE lcPaint_PenCreate (
   HANDLE hLcWnd,
   int Id,
   COLORREF Color,
   double Width,
   int PenStyle
 );

Parameters
hLcWnd
  Handle to LiteCAD graphics window.
Id
  Pen Identifier.
Color
  Line color (COLORREF type).
Width
  Line width (drawing's units).
PenStyle
  Pen style. Used only for zero line width. If the line width is not zero then line is always solid.
Can be one of the following values:

Style Meaning
LC_PS_SOLID Solid line
LC_PS_DASH Dashed line
LC_PS_DOT Dotted line
LC_PS_DASHDOT Line has alternating dashes and dots
LC_PS_DASHDOTDOT Line has alternating dashes and double dots

Return Value

  Handle to the created pen.
If the function fails, the return value is NULL.

Remarks

  Visible line width depends on window property LC_PROP_WND_LWMODE :

LWMODE Meaning
LC_LW_THIN Always 1 pixel line width
LC_LW_REAL Line width depends on current view scale in a window. Visible line width corresponds drawing's units.
LC_LW_PIXEL Constant width in pixels, depends on LC_PROP_WND_LWSCALE property value.
Visible width is calculated as
PixWidth = (int)((LineWidth / LWSCALE) + 0.5)

See Also

  lcPaint_PenSelectlcPaint_PenSelectID