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

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

Moderator: Alex

Post Reply
dixit.patel1
Posts: 14
Joined: Fri Feb 02, 2024 1:20 pm

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

Post 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);
}
Alex
Site Admin
Posts: 2319
Joined: Thu Jul 10, 2008 2:21 pm

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

Post 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
dixit.patel1
Posts: 14
Joined: Fri Feb 02, 2024 1:20 pm

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

Post 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);
}
Alex
Site Admin
Posts: 2319
Joined: Thu Jul 10, 2008 2:21 pm

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

Post 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
dixit.patel1
Posts: 14
Joined: Fri Feb 02, 2024 1:20 pm

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

Post by dixit.patel1 »

Hi,

Thank for Replay but now issue is resolved.
Post Reply