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 8442945
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T08:59:01+00:00 2026-06-10T08:59:01+00:00

I hope there will be an easy answer, as often times, something stripped out

  • 0

I hope there will be an easy answer, as often times, something stripped out of Compact Framework has a way of being performed in a seemingly roundabout manner, but works just as well as the full framework (or can be made more efficient).

Simply put, I wish to be able to do a function similar to System.Drawing.Graphics.DrawArc(…) in Compact Framework 2.0.

It is for a UserControl’s OnPaint override, where an arc is being drawn inside an ellipse I already filled.

Essentially (close pseudo code, please ignore imperfections in parameters):

FillEllipse(ellipseFillBrush, largeEllipseRegion);
DrawArc(arcPen, innerEllipseRegion, startAngle, endAngle); //not available in CF

I am only drawing arcs in 90 degree spaces, so the bottom right corner of the ellipse’s arc, or the top left. If the answer for ANY angle is really roundabout, difficult, or inefficient, while there’s an easy solution for just doing just a corner of an ellipse, I’m fine with the latter, though the former would help anyone else who has a similar question.

  • 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-06-10T08:59:02+00:00Added an answer on June 10, 2026 at 8:59 am

    I use this code, then use FillPolygon or DrawPolygon with the output points:

    private Point[] CreateArc(float StartAngle, float SweepAngle, int PointsInArc, int Radius, int xOffset, int yOffset, int LineWidth)
    {
        if(PointsInArc < 0)
            PointsInArc = 0;
    
        if(PointsInArc > 360)
            PointsInArc = 360;
    
        Point[] points = new Point[PointsInArc * 2];
        int xo;
        int yo;
        int xi;
        int yi;
        float degs;
        double rads;
    
        for(int p = 0 ; p < PointsInArc ; p++)
        {
            degs = StartAngle + ((SweepAngle / PointsInArc) * p);
    
            rads = (degs * (Math.PI / 180));
    
            xo = (int)(Radius * Math.Sin(rads));
            yo = (int)(Radius * Math.Cos(rads));
            xi = (int)((Radius - LineWidth) * Math.Sin(rads));
            yi = (int)((Radius - LineWidth) * Math.Cos(rads));
    
            xo += (Radius + xOffset);
            yo = Radius - yo + yOffset;
            xi += (Radius + xOffset);
            yi = Radius - yi + yOffset;
    
            points[p] = new Point(xo, yo);
            points[(PointsInArc * 2) - (p + 1)] = new Point(xi, yi);
        }
    
        return points;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I hope this question has an obvious answer to anyone who knows his way
is there an easy way to timeout an SQL statement so that it will
I hope this question will not be rejected as there is no code. But
I hope someone out there can shed some light on the topic of creating
Is there any way (utilizing Reflection I hope) that I can make an instantiated
I hope to know if there is a way to move row to the
I hope to know if there is a way to detect an item is
Is there an easy way to encrypt an SQL CE database that is provided
I'm sure there is an easy way to do this, so here goes. I'm
I hope there's someone who can help me suggest a suitable data model to

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.