Page 1 of 1

Dynamically Annotation Location Set X, Y

Posted: Fri Feb 02, 2024 1:30 pm
by dixit.patel1
Hi,

I am trying to set location dynamically on X and Y Coordination for Annotation but it is not come on exact location for give word.

Do Not using to MouseClick and MouseMove Event.

I am using below Code Snippet.

Code: Select all

AnnotationDataController objAnnotationDataController = new AnnotationDataController(AnnotationViewer.Images);
AnnotationDataCollection objAnnotationDataCollection = objAnnotationDataController[Pageindex - 1];

HighlightAnnotationData objHighlightAnnotationData = new HighlightAnnotationData();
objHighlightAnnotationData.Size = new Size(Convert.ToInt32(dr["Width"]), Convert.ToInt32(dr["Height"]));
objHighlightAnnotationData.FillBrush = new AnnotationSolidBrush(Color.Yellow);
objHighlightAnnotationData.Location = new Point(Convert.ToInt32(dr["X"]), Convert.ToInt32(dr["Y"]));
objHighlightAnnotationData.BlendingMode = BlendingMode.Multiply;
objHighlightAnnotationData.CanResize = false;
objHighlightAnnotationData.CanMove = false;

objAnnotationDataCollection.Add(objHighlightAnnotationData);

Re: Dynamically Annotation Location Set X, Y

Posted: Mon Feb 05, 2024 8:22 pm
by Alex
Hi,

You need to specify annotation location and annotation size in device independent pixels (DIPs). Please read more info here: https://www.vintasoft.com/docs/vsimagin ... _Data.html

Let me know if you will have any question or problem.

Best regards, Alexander

Re: Dynamically Annotation Location Set X, Y

Posted: Tue Feb 06, 2024 8:46 am
by dixit.patel1
It resolve my problem.

Thank you Alex.....