ReferencedImageAnnotationData Position getting changes on document.

Questions, comments and suggestions concerning VintaSoft Annotation .NET Plug-in.

Moderator: Alex

Post Reply
ankit.acharya
Posts: 4
Joined: Fri Jul 05, 2024 5:49 pm

ReferencedImageAnnotationData Position getting changes on document.

Post by ankit.acharya »

Hi Team,

We are using below code to create a point on document.

Code: Select all

private void AnnotationTool_MouseClick(object sender, VisualToolMouseEventArgs e)
{
     AnnotationVisualTool sAnnotationVisualTool = (AnnotationVisualTool)sender;
     //Point mp = sAnnotationVisualTool.ImageViewer.PointToImage(Control.MousePosition);
     if (e.Button == MouseButtons.Right)
     {
         AnnotationViewer.AnnotationInteractionMode = AnnotationInteractionMode.Author;
         try
         {
             Point objPoint = new Point(e.X, e.Y);
             ReferencedImageAnnotationData objReferencedImageAnnotationData = new ReferencedImageAnnotationData();
             objReferencedImageAnnotationData.Image.SetImage(BitmapToVintasoftImage(global::Advantmed.RiskAdjustment.Application.Properties.Resources.AnnotationDot_Green));
             objReferencedImageAnnotationData.CreatedBy = Convert.ToString(NLPDataID);
             objReferencedImageAnnotationData.ModifiedBy = Convert.ToString(PageAnnotation);
             objReferencedImageAnnotationData.Name = "";
             objReferencedImageAnnotationData.Intent = strDiagnosis;
             objReferencedImageAnnotationData.Size = new SizeF((DotWidth / 2), (DotHeight / 2));
             objReferencedImageAnnotationData.Location = AnnotationViewer.PointFromControlToDip(objPoint);
             objReferencedImageAnnotationData.Border = false;
             objReferencedImageAnnotationData.CanMirror = false;
             objReferencedImageAnnotationData.CanResize = false;
             objReferencedImageAnnotationData.CanRotate = false;
             objReferencedImageAnnotationData.CanMove = true;
             if (objReferencedImageAnnotationData != null)
             {
                 AnnotationViewer.AddAndBuildAnnotation(objReferencedImageAnnotationData);
             }
             AnnotationViewer.FinishAnnotationBuilding();
         }
     }
}
Same way we are drawing again with below method and location is getting changed. We are getting point on different location.

Code: Select all

ReferencedImageAnnotationData objReferencedImageAnnotationData = new ReferencedImageAnnotationData();
Point objPoint = new Point(Convert.ToInt32(drPagewise[i]["X"]), Convert.ToInt32(drPagewise[i]["Y"]));
objReferencedImageAnnotationData.Location = AnnotationViewer.PointToClient(objPoint);
objReferencedImageAnnotationData.Size = new Size(Convert.ToInt32(drPagewise[i]["Width"]), Convert.ToInt32(drPagewise[i]["Height"]));
objReferencedImageAnnotationData.CanResize = false;
objReferencedImageAnnotationData.Border = false;
objReferencedImageAnnotationData.ToolTip = Tooltip;
objReferencedImageAnnotationData.CanRotate = false;
objReferencedImageAnnotationData.CanMirror = false;
objReferencedImageAnnotationData.CanMove = (clsCoding.StageID == 5 || clsCoding.StageID == 11 || clsCoding.StageID == -97 || clsCoding.StageID == -99) ? false : true;
if (objReferencedImageAnnotationData != null)
{
    AnnotationViewer.AddAndBuildAnnotation(objReferencedImageAnnotationData);
}
AnnotationViewer.FinishAnnotationBuilding();
Thank you,
Ankit Acharya
Alex
Site Admin
Posts: 2393
Joined: Thu Jul 10, 2008 2:21 pm

Re: ReferencedImageAnnotationData Position getting changes on document.

Post by Alex »

Hello Ankit,

Please send us (to support@vintasoft.com) a small console project, which demonstrates the problem, and we will try to help you.

Best regards, Alexander
Post Reply