Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

X and Y is (0;0) in the center of the image.

$
0
0

Hi,

I have a pictureBox1 with an image in it and I have label1 and label2. I have the X and Y coordinates of the pictureBox1 into label1 and label2 (label1 = X and label2 = Y).

Now comes the problem:

The coordinate (0;0) is at the top-left of the image, but I want that (0;0) is the exact center of the image..

Can someone help?

I need it for a school project.

Code:

private void pictureBox1_MouseMove(object sender, MouseEventArgs e)
        {
            label1.Text = e.X + "";
            label2.Text = e.Y + "";
        }


Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>