Page 1 of 1

Border around image displayed in WpfAnnotationViewer

Posted: Fri Jun 01, 2018 6:12 pm
by gpbabu
Hello Alex,

We are displaying a captured image centered in WpfAnnotationViewer with white background. These captured images have lot of white space. Is there anyway to set a border for the displayed image so that it is visually separated from the background.

Thanks
Babu

Re: Border around image displayed in WpfAnnotationViewer

Posted: Fri Jun 01, 2018 8:35 pm
by Alex
Hello Babu,

You can set the border color in WPF image viewer using the WpfImageViewer.ImageBorderColor property:
https://www.vintasoft.com/docs/vsimagin ... Color.html

Border with can be set using the WpfImageViewer.ImageBorderWidth property:
https://www.vintasoft.com/docs/vsimagin ... Width.html

Best regards, Alexander

Re: Border around image displayed in WpfAnnotationViewer

Posted: Fri Jun 01, 2018 11:30 pm
by gpbabu
Hello Alex,

Thank you for the input. We were using 8.5 version. Now upgraded to 8.6 and have tried with the WpfAnnotationDemo application and couldn't see the image border. Do we need to make any other changes?

Regards
Babu

<vsai:WpfAnnotationViewer Grid.Row ="0" x:Name="annotationViewer"
Background="#FFEEEEEE" ImageBorderColor="Blue" ImageBorderWidth="4"
Width="Auto" Height="Auto" SizeMode="BestFit"
ZoomChanged="annotationViewer_ZoomChanged"
ImageLoadingProgress="annotationViewer_ImageLoadingProgress"
ImageLoading="annotationViewer_ImageLoading"
ImageLoaded="annotationViewer_ImageLoaded"
AnnotationInteractionModeChanged="annotationViewer_AnnotationInteractionModeChanged"
AnnotationTransformingStarted="annotationViewer_AnnotationTransformingStarted"
AnnotationTransformingFinished="annotationViewer_AnnotationTransformingFinished"
FocusedAnnotationViewChanged="annotationViewer_FocusedAnnotationViewChanged"
InputGestureCopy="{x:Null}"
InputGestureCut="{x:Null}"
InputGestureInsert="{x:Null}"
InputGestureDelete="{x:Null}"
PreviewKeyDown="annotationViewer_PreviewKeyDown"
RendererCacheSize="256">

Re: Border around image displayed in WpfAnnotationViewer

Posted: Mon Jun 04, 2018 3:01 pm
by Alex
Hello Babu,

The WpfImageViewer.ImageBorderColor and WpfImageViewer.ImageBorderWidth properties are specifying the border color and width for not focused image. I think you are using image viewer in single page view mode and this is reason of your problem.

For adding the border to the image in single page view mode you need set the following properties:
  • UseImageAppearancesInSinglePageMode = True
  • FocusedImageBorderColor = Blue
  • FocusedImageBorderWidth = 4
Best regards, Alexander

Re: Border around image displayed in WpfAnnotationViewer

Posted: Wed Jun 06, 2018 4:56 pm
by gpbabu
Thanks Alex. It works with these settings.