tags:

views:

30

answers:

1

Hi,

Also i need to be able to draw arcs in user defined locations. My current code only lets me put it in one location in my picturebox. Here is my code:

            if (DrawShape == 3)
            {
                g.Clear(Color.Transparent);
                g.DrawImage(StoredImage, 0, 0);
                g.DrawArc(Pens.Indigo, pictureBox1.Size, e.Location.X - MousePosition.X,e.Location.Y - MousePosition.Y);
             }

Thanks

+1  A: 

When you do g.Clear() it clears whatever is in the picture box. Remove that line and you should be able to draw more.

Drackir
It doesn't like the fact that i don't have a start float angle and end float angle, i don't know what i should put in and do?
Chris Bacon
Check here for info on how `DrawArc` works: http://msdn.microsoft.com/en-us/library/ms142028.aspx I think you're using the rectangle incorrectly.
Drackir
So looking at the code on this site, how do i make it so it can be drawn when the user clicks on the form?
Chris Bacon
The site you have given me that is
Chris Bacon
You already have that code, it's just your DrawArc that's being written incorrectly. One key is that the mouse coordinates should be in the rect, not in the two angle values. Try taking the example code and plugging it into your code.
Drackir