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?

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.