CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 1999
    Posts
    14

    How To: get CPen to be square on the end ...

    ... (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
    [email protected]


  2. #2
    Join Date
    Apr 1999
    Posts
    37

    Re: How To: get CPen to be square on the end ...

    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




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured