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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:41:54+00:00 2026-06-10T05:41:54+00:00

How can i draw a polygon according to the input coordinates which are given

  • 0

How can i draw a polygon according to the input coordinates which are given in C#.

enter image description here

  • 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-10T05:41:55+00:00Added an answer on June 10, 2026 at 5:41 am

    You didn’t show any code because based on those coordinate, you are applying some form of scaling to the image.

    Using the Paint event of a PictureBox, here is an example using those coordinates on the screen. It fills in the polygon, then draws the border, then it loops through all the points to draw the red circle:

    void pictureBox1_Paint(object sender, PaintEventArgs e) {
      e.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
      e.Graphics.Clear(Color.White);
    
      // draw the shading background:
      List<Point> shadePoints = new List<Point>();
      shadePoints.Add(new Point(0, pictureBox1.ClientSize.Height));
      shadePoints.Add(new Point(pictureBox1.ClientSize.Width, 0));
      shadePoints.Add(new Point(pictureBox1.ClientSize.Width,
                                pictureBox1.ClientSize.Height));
      e.Graphics.FillPolygon(Brushes.LightGray, shadePoints.ToArray());
    
      // scale the drawing larger:
      using (Matrix m = new Matrix()) {
        m.Scale(4, 4);
        e.Graphics.Transform = m;
    
        List<Point> polyPoints = new List<Point>();
        polyPoints.Add(new Point(10, 10));
        polyPoints.Add(new Point(12, 35));
        polyPoints.Add(new Point(22, 35));
        polyPoints.Add(new Point(24, 22));
    
        // use a semi-transparent background brush:
        using (SolidBrush br = new SolidBrush(Color.FromArgb(100, Color.Yellow))) {
          e.Graphics.FillPolygon(br, polyPoints.ToArray());
        }
        e.Graphics.DrawPolygon(Pens.DarkBlue, polyPoints.ToArray());
    
        foreach (Point p in polyPoints) {
          e.Graphics.FillEllipse(Brushes.Red, 
                                 new Rectangle(p.X - 2, p.Y - 2, 4, 4));
        }
      }
    }
    

    enter image description here

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

Sidebar

Related Questions

I can draw a circle around a given point (x,y) with a command like
I am working on Polygon Dragging , also Resizing of Polygon. I can draw
How can i draw polygon with points read from NSMutableArray object in cocos2D framework?
With the code below I can draw a polygon on a map, however the
How can I draw anti-aliased triangle on ListBoxDrawItem? ListBox.Canvas.Polygon draws with jags. Thanks!!!
I need to draw a polygon in Pascal(dev-pascal) which has semicircles at its sides.
I can draw many things using this : NSString *imagePath = [[NSBundle mainBundle] pathForResource:@dummy2.png
i can draw a string/image... with drawInRect/drawAtPoint. but how about if i want to
How i can draw hand free graphic objects in windows 8, like paint can.
In Visual studio I can draw 13 different application-icons in different resolutions and color

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.