Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 75479
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T20:31:21+00:00 2026-05-10T20:31:21+00:00

The MSDN documentation is (somewhat) clear about the following two facts about GDI Pens:

  • 0

The MSDN documentation is (somewhat) clear about the following two facts about GDI Pens:

  1. A Cosmetic pen (create via CreatePen or ExtCreatePen w/ PS_COSMETIC) must be 1 unit wide (well, <= 1, but let’s not go there).

  2. A Geometric (ExtCreatePen w/ PS_GEOMETRIC) pen must solid (PS_SOLID only, no PS_DASH, etc). They can, however, draw fatter lines. This is clearly documented in the link I put above as only a 9x restriction (I’m dumb). To my defense (bad) comments and (broken) logic in my code led me to believe otherwise. Some other googled articles must have been written concidering only Windows 9x.

Why can I voilate these rules and have GDI happily draw with these Pens?

I can create fat (width = 10, for example) cosmetic pens and dashed Geometric pens. Heck, I can create a fat, dashed geometric pen!

These Pens seem to work fine usually. The only problem I’ve seen is in Polyline when I pass very large arrays of points – it renders the lines very slowly. However, Polyline is acting strangely with large arrays in general – it justs acts differently with the bad pens. (my other polyline problems may be another question…)

Is it ever safe to use wide Cosmetic pens or wide Geometric with patterns?

  • 1 1 Answer
  • 3 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T20:31:22+00:00Added an answer on May 10, 2026 at 8:31 pm

    In general you should adhere to the documented API, otherwise you risk relying on OS version specific behaviour.

    The ExtCreatePen restrictions you describe (e.g, no PS_DASH with PS_GEOMETRIC) only apply to Win9x, not WinNT, so on NT/2000/XP your ‘fat, dashed geometric pen’ shouldn’t be a problem. Also note that Polyline has some limitations on Win9x.

    If you want dashed lines, I’d suggest using PS_USERSTYLE so that you control the lengths of the dashes and gaps, rather than relying on whatever default PS_DASH gives you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

According to the MSDN documentation for the RSA class there are two RSA.Create() methods
The msdn documentation about order preservation in PLINQ states the following about ForAll() .
For example the following cast can be found littered throughout the MSDN documentation: (LPTSTR)&lpMsgBuf
I have looked at the documentation on MSDN about these 2 functions. However, I
The MSDN documentation shows two options for setting up the onactivated event for Win8
According to the MSDN documentation on the List<T>.Clear method : This method is an
According the the MSDN documentation, the following code should output '5' to the console
Reading the MSDN documentation for Socket.AcceptAsync I am still not entirely clear if there
I was reading the MSDN documentation about Conversation Window Extensions and all of the
I have a question about Microsoft's MSDN documentation for the Extenstions.GetSchemaInfo Method (XElement) for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.