Save only the visible part of the image

Questions, comments and suggestions concerning VintaSoft Imaging .NET SDK.

Moderator: Alex

Post Reply
Ektoplasma
Posts: 4
Joined: Sun Feb 16, 2014 9:07 pm

Save only the visible part of the image

Post 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
Alex
Site Admin
Posts: 2362
Joined: Thu Jul 10, 2008 2:21 pm

Re: Save only the visible part of the image

Post 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
Post Reply