Page 1 of 1

Right click to added Image on document viewer using c# windows application

Posted: Wed Feb 07, 2024 10:23 am
by dixit.patel1
annotationViewer1_MouseClick Event using image added on right click but, it is not added image in all tiff files, shows wrong position and not showing image on document viewer.

I am using below Code Snippet.

Code: Select all

if (e.Button == MouseButtons.Right)
{
    ImageCollection objImageCollection = new ImageCollection();
    AnnotationDataController objAnnotationDataController = new AnnotationDataController(annotationViewer1.Images);
    objImageCollection.Add("AnnotationDot_Green.png");

    PointF objPointF = new PointF(e.X, e.Y);
    AnnotationDataCollection objAnnotationDataCollection = objAnnotationDataController[objImageCollection.Count - 1];
    RectangleAnnotationData objRectangleAnnotationData = new RectangleAnnotationData();
    objRectangleAnnotationData.Size = new SizeF(30, 30);
    objRectangleAnnotationData.FillBrush = new AnnotationSolidBrush(Color.AliceBlue);
    objRectangleAnnotationData.Location = annotationViewer1.PointFromControlToDip(objPointF);
    objAnnotationDataCollection.Add(objRectangleAnnotationData);
}

Re: Right click to added Image on document viewer using c# windows application

Posted: Wed Feb 07, 2024 4:37 pm
by Alex
Hello,

The rectangle annotation has location in the annotation center. Please read about annotation coordinate system and annotation location here: https://www.vintasoft.com/docs/vsimagin ... _Data.html

Best regards, Alexander

Re: Right click to added Image on document viewer using c# windows application

Posted: Thu Feb 08, 2024 9:42 am
by dixit.patel1
Hi,

I am using below Code for Load Image Annotation but getting plus cursor after loading image annotation. not able to remove plus cursor.

Please guide.

Code: Select all

string _embeddedOrReferencedImageFileName = string.Empty;
if (string.IsNullOrEmpty(_embeddedOrReferencedImageFileName))
    _embeddedOrReferencedImageFileName = @"D:\Dixit\Projects\VintasoftDemoApp_RiskAdjustment\VintasoftDemoApp_RiskAdjustment - Copy\AnnotationDot_Green.png";
ReferencedImageAnnotationData referencedImage = new ReferencedImageAnnotationData();
referencedImage.Size = new SizeF(25, 25);
referencedImage.Location = annotationViewer1.PointFromControlToDip(objPoint);
referencedImage.Filename = _embeddedOrReferencedImageFileName;

if (referencedImage != null)
{
    AnnotationViewer.AddAndBuildAnnotation(referencedImage);
}

Re: Right click to added Image on document viewer using c# windows application

Posted: Thu Feb 08, 2024 11:26 am
by Alex
Hello,

Please send us (to support@vintasoft.com) a small project, which demonstrates the problem. We need to reproduce your problem on our side.

Best regards, Alexander

Re: Right click to added Image on document viewer using c# windows application

Posted: Thu Feb 08, 2024 2:45 pm
by dixit.patel1
Hi,

Thank for Replay but now issue is resolved.