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

  • Home
  • SEARCH
  • 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 523545
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:28:25+00:00 2026-05-13T08:28:25+00:00

I have a need to do some drawing using win32/GDI (Native, not .NET), and

  • 0

I have a need to do some drawing using win32/GDI (Native, not .NET), and I’ve run into the following problem:

I need to draw lines that are “styled.” For example, in the attached image, the line marked “A” is a straight line as far as my application data is concerned, it just needs to be drawn with the additional zigzag as a style. Of course, this is easy to do programatically, but it gets more complicated when the line can be at any angle (“B”) or even a bezier curve (“C”).

Now, I could do this all programatically, painstakingly doing the math to put a zigzag around each line possibility, but that will take a lot of time and, more importantly, be rather error prone.

Is it possible to just give windows/GDI a “style” to apply to the line, perhaps a bitmap like the one marked “D”, and have it use that as a pen to draw the lines? If not, is there a more flexible and less error-prone way of doing this than writing a bunch of specific drawing code for each of the “styled” lines?

*Apparently first timers can’t post images. Examples can be found at https://i.stack.imgur.com/oMFbc.png

  • 1 1 Answer
  • 0 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. Editorial Team
    Editorial Team
    2026-05-13T08:28:25+00:00Added an answer on May 13, 2026 at 8:28 am

    This is not possible in Win32 GDI. You will need to do the math yourself.

    It should be noted however, that you can obtain the points used to make up the line or curve which should make it substantially easier.

    See this “Hit-Testing” tutorial for an example.

    • http://msdn.microsoft.com/en-us/library/ms969920.aspx

    For a bezier curve you would use Path Functions:

    • BeginPath
    • PolyBezier
    • EndPath
    • FlattenPath

    For straight lines you could use:

    LineDDA

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

Sidebar

Related Questions

I need some help writing a regex. I have the following strings, xxx.yyy.wwwwwaaa_IN_123 xxx.rrrttttt_IN_12355
I am drawing some points in an array using glVertex2f(), and I need to
I'm drawing some graphics and text with GDI in my CScrollView. I need to
I have a need for some kind of information that is in essence static.
Developing a project of mine I realize I have a need for some level
Just need some quick clarification I have 2 Queries in my Access Database that
I need some advice for a design which I have to implement in application.
I need some help with a work project I have been assigned. At the
I need some help with PHP Class. I have limited knowledge about how it
I need some advice of how to setup my tables I currently have a

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.