Thread: GDI - Issue while drawing Arc

  1. #1
    Registered User
    Join Date
    Dec 2011
    Posts
    12

    Question GDI - Issue while drawing Arc

    Hello,

    I am trying to make, Arc, Using GDI. There is a problem that I am facing while rendering Arc for the angles life, 90 to 91, 180 to 181, 270 to 271. Following is the code and output snapshot.

    // CODE
    ...

    // Create a geometric pen.

    LOGBRUSH logBrush;
    logBrush.lbStyle = BS_SOLID;
    logBrush.lbColor = RGB(0,0,0);
    CPen myPen2(PS_SOLID|PS_GEOMETRIC|PS_ENDCAP_SQUARE |PS_JOIN_MITER, 50, &logBrush);
    pDC->SelectObject(&myPen2);

    // First arc of 270 degree
    pDC->Arc(100,100,300,300,200,100,100,200);//at angle 270

    // second arc of 90 degree
    pDC->MoveTo(450,400);
    pDC->AngleArc(450, 400, 150, 0.0f, 90.0f);

    ...

    Here is the output :

    GDI - Issue while drawing Arc-correct_arcs-jpg



    THIS OUTPUT IS CORRECT ... Follow the below small step to get the unexpected behaviour.
    and when I change the angle the output is wiered. Check by changing the last parameter of first arc to 202 instead of 200. And change the angle, of second arc to 91.0f, to see the problem.
    this is only happening for angles like, 91, 181, 271. I am not sure how this is happening, may be some quadrant related calculations are causing this. :S
    Can anybody tell me how I can fix this issue ? Is this related to joints ? can you guide me what exactly is SetMiterLimit(...) does ?
    Is this is API issue ?
    Thanks in advance.
    NJ

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    Cross post - GDI - Issue while drawing Arc

    Please reply there.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. bandwidth issue / network issue with wireless device communication
    By vlrk in forum Networking/Device Communication
    Replies: 0
    Last Post: 07-05-2010, 11:52 PM
  2. drawing gone
    By manzoor in forum C# Programming
    Replies: 0
    Last Post: 01-18-2009, 05:45 AM
  3. GDI Drawing Help
    By The Brain in forum Windows Programming
    Replies: 3
    Last Post: 10-20-2005, 02:01 AM
  4. GIF not drawing sometimes.
    By adrianxw in forum Tech Board
    Replies: 23
    Last Post: 03-19-2003, 03:01 AM
  5. Drawing
    By SushiFugu in forum Windows Programming
    Replies: 1
    Last Post: 02-15-2002, 06:13 PM