Click to See Complete Forum and Search --> : How To: get CPen to be square on the end ...


craig knutson
May 11th, 1999, 02:05 PM
... (this is barely graphics)

i use the following createpen statement:


m_penLine.CreatePen(
PS_SOLID
,m_rectSplitterBar.Height()
,RGB(192,192,192) // light gray
);




to create a pen that i use to draw a line across a dialog. (i use it as a "sizing line" for dragging a splitter type of bar).

the right "end cap" is rounded, (kind of).

i've tried:


m_penLine.CreatePen(
PS_SOLID & PS_ENDCAP_SQUARE
,m_rectSplitterBar.Height()
,RGB(192,192,192) // light gray
);




but then the line gets real thin, i guess it has to do with the PS_ENDCAP_SQUARE thing. i believe this really should be used with PS_GEOMETRIC.

i'm just wondering, how can i get the pen to have square ends?

thanks for any info you can provide.

craigk
cknutson@flash.net

tangzibo
May 13th, 1999, 10:25 PM
Following messages are pasted from "INFO: Developing Win32-Based GDI Apps for Win 95 and Windows NT":

Windows NT provides a wide variety of pens. There are some limitations on pens in Windows 95:

The ExtCreatePen() function only supports the PS_SOLID style for geometric lines.
The PS_USERSTYLE and PS_ALTERNATE styles are not supported.
Dashed or dotted pen styles like PS_DASH, for example, are not supported in wide lines.

The following pen styles for geometric lines are supported in paths only in Windows 95:

PS_ENDCAP_ROUND, PS_ENDCAP_SQUARE, PS_ENDCAP_FLAT, PS_JOIN_BEVEL,
PS_JOIN_MITER, and PS_JOIN_ROUND