title: Convert screen coordinates to picture coordinates
body: <p>I have the following problem: A program displays a picture using a <code>PictureBox</code>. The picture contains two rectangles A and B that are drawn after the image is loaded. </p>
  
  <p><img src="https://i.stack.imgur.com/Tp1Vr.png" alt="Illustration"></p>
  
  <p>The image inside the picture box is zoomed and the rectangles A and B are painted using the <code>Graphics</code> object of the loaded image. Is there a simple method to determinate if a user clicked the area inside these rectangles e.g. converting screen coordinates to picture coordinates.</p>
  
  <p><em>Edit: No longer relevant, found another solution.</em></p>
  
  <p><em>Edit 2: My solution was to use two picture boxes at the A and B location instead of modifying the image directly. It has some minor disadvantages specific to my solution, but I had to finish the project in time</em></p>