0

Hey I'm making a small application for my gaming buddies, and I have a picturebox that I'm drawing on.

The problem is, it appears as though the Location property of the MouseEventArgs is wrong, and it becomes even more so toward the bottom + right portion of the picture, like a lack of precision that gets multiplied as x and y increase.

Do I need to use a different way to get the mouse cursor location?

1
Contributor
1
Reply
2
Views
6 Years
Discussion Span
Last Post by pseudorandom21
0

Wow, nevermind.

I had created my a Graphics object from the image like this:

Graphics g = Graphics.FromImage( pictureBox.Image );

Which is wrong, and it should be:

Graphics g = pictureBox.CreateGraphics();

Now it's working just fine.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.