Jump to content

Drawing in C#

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1
Alex_j

Alex_j

    Newbie

  • Members
  • PipPip
  • 29 posts
I need to draw a circle on top of an image in C#, so whenever the dice in my game is rolled a circle is placed upon the corresponding box.

How could I go about this? I have the image already, just need to be pointed in the direction of drawing the circle.

#2
Davide

Davide

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 506 posts
You will need the coordinates in the form of the upper left corner of the image. You can get them in the designer file.
            Graphics g = pe.Graphics;
            Brush b = new SolidBrush(Color.Black);
            Pen x = new Pen(b);

            g.DrawEllipse(pent, XCoordinate, YCoordinate, Width, Height);

Are you a newbie programmer trying to learn C#? Check out my small tutorial: Visual C# Programming Basics