Page 1 of 1

Save only the visible part of the image

Posted: Fri Feb 21, 2014 1:21 pm
by Ektoplasma
Hi Alex,

I would like to save just the visible part of the image which is shown in
the imageViewer. For example after zooming I would like to crop the visible
part and save it as a new image. How can I do that?

Thank you for your help,
Best regards,
Heinz

Re: Save only the visible part of the image

Posted: Mon Feb 24, 2014 12:03 pm
by Alex
Hello Heinz,

You can get visible part of WPF image viewer using the WpfImageViewer.GetCurrentImageRect(Rect,Boolean) method.

Here is an example:

Code: Select all

VintasoftImage imageViewerVisiblePart = WpfImageViewer1.GetCurrentImageRect(WpfImageViewer1.ViewerState.ImageVisibleRect, true);
Best regards, Alexander