0

I have Large image in PictureBox with SizeMode = Zoom. How can I get pixel coords from image when I click on PictureBox or how get image position and size in this case? Thanks all for any help.

View app window

Yozheg
  • 1
  • 3

1 Answers1

0

I found an answer:

double H_or_W = Math.Max(pictureBox1.Image.Width  pictureBox1.ClientSize.Width, pictureBox1.Image.Height  pictureBox1.ClientSize.Height);

Size NewSize = new Size((int)(pictureBox1.Image.Width / H_or_W), (int)(pictureBox1.Image.Height / H_or_W));
Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77
Yozheg
  • 1
  • 3