0

I want to know how to find the length and width of the image that has been re-sized to fit in the picturebox zoom mode

I tried this code but I got the original image size which I don't want.

PictureBox2.Width PictureBox2.Height

  • 1
    https://referencesource.microsoft.com/#System.Windows.Forms/winforms/Managed/System/WinForms/PictureBox.cs,5c2ab37313f547c2 – Hans Passant May 23 '19 at 12:08
  • @HansPassant that link blows my mind – Mr. Tripodi May 23 '19 at 12:42
  • See this question: [Translate Rectangle Position in Zoom Mode Picturebox](https://stackoverflow.com/q/53800328/7444103). Reza Aghaei posted an implementation based of the source code that Hans linked, I posted a class that provides some methods to do the same thing without using reflection (just some math). – Jimi May 23 '19 at 13:03

0 Answers0