i try to resize the image after crop command executed and reset.
i put the command on the resetSettings() function of croptool.
public void ResetSettings()
if (this.ReserveWidth > 0 || this.ReserveHeight > 0)
this.imageEditor.ExecuteCommand(ImageCommands.Resize,new ResizeCommandContext(ReserveWidth, ReserveHeight));
this.cropAdorner.CropRect = new Rect(
this.imageEditor.Image.Width * 0.1,
this.imageEditor.Image.Height * 0.1,
this.imageEditor.Image.Width * 0.8,
this.imageEditor.Image.Height * 0.8
this.ReserveWidth = 0;
this.ReserveHeight = 0;
this.isDirty = false;
But this throws exceptions.
Could you help me to figure it out?
my propose is that I want to implement a function like Photoshop that ,when you crop an image with desire width and height, you input width and height in the tool settings, then when you drag the crop rectangle, it is always keep the ratio.
for example, you input width 468px and height 250px.
you can drag the crop size to (468*n) X (250*n), but finally you execute the change,
The image will crop to the drag size and scale to reserved size.