Adding annotations to viewer (WPF)

Discussions about annotation support.
Post Reply
goldrian
Posts: 22
Joined: Fri Jun 03, 2011 7:57 pm

Adding annotations to viewer (WPF)

Post by goldrian » Tue Jun 14, 2022 3:54 pm

Hi!
I've seen the examples about adding annotations, but I feel I'm missing something.
If I write the following code I see the image but not the ellipse.
What's the problem here?

Code: Select all

viewer.DisplayFromByteArray(bytes);
viewer.ZoomMode = ViewerZoomMode.ZoomModeFitToViewer;
viewer.MouseMode = ViewerMouseMode.MouseModeDefault;
viewer.SetAnnotationEditorMode(true);

AnnotationManager annotMgr = viewer.GetAnnotationManager();
annotMgr.SelectPage(1);

var ellipse = annotMgr.AddEllipseAnnot(System.Drawing.Color.White, 0, 0, 400, 400);
if ((annotMgr.GetStat() == GdPictureStatus.OK) && (ellipse != null))
{
            ellipse.BorderWidth = 50f;
            ellipse.Fill = true;
            ellipse.FillColor = System.Drawing.Color.Yellow;
}

annotMgr.Close();
viewer.SetAnnotationEditorMode(false);
viewer.ReloadAnnotations();
viewer.Redraw();
Thanks

goldrian
Posts: 22
Joined: Fri Jun 03, 2011 7:57 pm

Re: Adding annotations to viewer (WPF)

Post by goldrian » Tue Jun 14, 2022 3:58 pm

Autoanswer: I'm missing this

Code: Select all

annotMgr.SaveAnnotationsToPage();
:roll:

Hugo
Posts: 227
Joined: Tue Dec 18, 2018 10:09 am

Re: Adding annotations to viewer (WPF)

Post by Hugo » Wed Jun 15, 2022 1:52 pm

Hi Goldrian,

I am glad you solved your own issue.

If you need any further help or guidance with our methods do not hesitate to contact us here or even privately here:
https://orpalis.zendesk.com/hc/en-us/requests/new

Regards,
Hugo Cudd
Technical Support

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest