Page 1 of 1

Adding annotations to viewer (WPF)

Posted: Tue Jun 14, 2022 3:54 pm
by goldrian
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

Re: Adding annotations to viewer (WPF)

Posted: Tue Jun 14, 2022 3:58 pm
by goldrian
Autoanswer: I'm missing this

Code: Select all

annotMgr.SaveAnnotationsToPage();
:roll:

Re: Adding annotations to viewer (WPF)

Posted: Wed Jun 15, 2022 1:52 pm
by Hugo
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