PgSetStrokeWidth(), PgSetStrokeFWidth(), PgSetStrokeWidthCx(), PgSetStrokeFWidthCx()

Set line thickness


int PgSetStrokeWidth( int width );

long PgSetStrokeFWidth( long width );

int PgSetStrokeWidthCx( PhGC_t *gc,
                        int width );

long PgSetStrokeFWidthCx(  PhGC_t *gc,
                           long width );




These functions set the thickness of lines.

If you call PgSetStrokeWidth*(), the width argument takes an integer that indicates the width of the line in pixels. But if you call PgSetStrokeFWidth*(), the width argument takes a pixel width multiplied by 65,536 (0x10000). For example, specifying a value of 0x80000 will set the line width to 8 pixels.

Note: The minimum line width for PgSetStrokeFWidth*() is one pixel.

PgSetStrokeWidth() and PgSetStrokeFWidth() work on the current graphics context, while you can specify the graphics context gc for PgSetStrokeWidthCx() and PgSetStrokeFWidthCx().


The previous width.



Interrupt handler No
Signal handler No
Thread No


We don't recommend using a line width greater than one pixel. Some graphics drivers might give unexpected results.

See also:

PgDefaultStroke*(), PgDrawEllipse*(), PgDrawLine*(), PgDrawPolygon*(), PgDrawRect*(), PgDrawRoundRect*(), PgSetDrawMode*(), PgSetStrokeCap*(), PgSetStrokeColor*(), PgSetStrokeDash*(), PgSetStrokeDither*(), PgSetStrokeJoin*(), PgSetStrokeTransPat*(), PgSetStrokeXORColor*()

Drawing attributes and Lines, pixels, and pixel arrays in the Raw Drawing and Animation chapter of the Photon Programmer's Guide