0

There is a topic How can I crop original image in a pictureBox that shows image in Stretch mode?

I have the same qusetion, but now it's about Zoom mode.

What formula do I use to determine coordinates for crop area in this situation?

Spica
  • 63
  • 6
  • You can find the functions you need [here](https://stackoverflow.com/questions/56360036/crop-correct-part-of-image-while-the-picturebox-is-in-zoom-mode/56362612#56362612) (Never mind the revenge downvote there ;-) – TaW Jul 16 '19 at 15:32
  • @TaW I'm trying to open the resulting bitmap in a new form, but seems like pictureBox2 works with some functions. How do I get rid of this picturebox without crushing the algorithm? – Spica Jul 16 '19 at 16:14
  • See the two asnwers here (two different methods to calculate the offsets): [Translate Rectangle Position in Zoom Mode Picturebox](https://stackoverflow.com/q/53800328/7444103). Reza Aghaei's uses the internal method provided by the PictureBox itself. My code provides a set of methods to calculate different offsets based on the current state of a PicureBox (I posted only methods related to the Zoom Mode, it's more or less the same for the Stretch Mode, it's just an additional check on the Scale factor). – Jimi Jul 16 '19 at 16:36
  • See also: [How to crop a section of an Image at cursor position?](https://stackoverflow.com/a/56128394/7444103) – Jimi Jul 16 '19 at 16:43

0 Answers0