Ruben2776 / PicView

Fast, free and customizable image viewer for Windows 10 and 11.
https://picview.org
Other
995 stars 66 forks source link

Add support for cropping function to work when zoomed in #44

Open Ruben2776 opened 2 years ago

Ruben2776 commented 2 years ago

Currently the crop function do not save correctly when zoomed in, since I do not know how to calculate that.

The zoom function is based on a heavily modified version of ZoomBorder.cs, which is based on changing the values of ScaleTransform and TranslateTransform. My code is at /PicView/UILogic/TransformImage/Zoom.cs

The cropping is based on https://github.com/dmitryshelamov/UI-Cropping-Image my code is at PicView/Editing/Crop

GetCrop() line 136 in CropFunctions.cs is where the calculation takes place. ImageMagick libraries takes care of the actual cropping.