VintaSoft Annotation .NET Plug-in Discussions
Questions, comments and suggestions concerning VintaSoft Annotation .NET Plug-in.
Board index < VintaSoft Imaging < VintaSoft Annotation .NET Plug-in Discussions
Private Sub InteropUserControl_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles AnnotationViewer1.DoubleClick
Dim eMouse As MouseEventArgs
If AnnotationViewer1.SelectionMode = Vintasoft.Annotation.SelectionMode.AnnotationView Then
eMouse = DirectCast(e, MouseEventArgs)
If _zoomSelection Is Nothing Then
_zoomSelection = New ZoomSelection(_imageViewer)
End If
AnnotationViewer1.VisualTool = _zoomSelection
_mouseX = eMouse.X.ToString
_mouseY = eMouse.Y.ToString
_zoomSelection.Rectangle = New Rectangle(CInt(eMouse.X - 300), CInt(eMouse.Y - 200), 600, 400)
_zoomSelection.Zoom()
End If
End Sub
But never the zoom appears on the selected recangle or the rectangle not created on the place the user has clicked.private void ZoomAfterDoubleClick()
{
...
ImageViewer1.DoubleClick += new EventHandler(ImageViewer1_DoubleClick);
ImageViewer1.Images.Add(Path.Combine(WorkDir, "testimage.tif"));
...
}
void ImageViewer1_DoubleClick(object sender, EventArgs e)
{
MouseEventArgs eMouse;
eMouse = e as MouseEventArgs;
Point pointOnImage = imageViewer1.PointToImage(eMouse.Location);
ZoomSelection selection = new ZoomSelection(ImageViewer1);
ImageViewer1.VisualTool = selection;
selection.Rectangle = new Rectangle(pointOnImage.X - 300, pointOnImage.Y - 200, 600, 400);
selection.Zoom();
}
Best regards, Alexander