by RobertHorn » Fri Feb 03, 2012 6:35 pm
Hi Loic,
I have done the following to workout the exact pixels of the image where the annotation is:
HorizontalResolution = imageViewer.HorizontalResolution
VertialResolution = imageViewer.VerticalResolution
PixTop = AnnotationTop / VertialResolution
PixHeight = AnnotationHeight / VertialResolution
PixWidth = AnnotationWidth / HorizontalResolution
PixLeft = AnnotationLeft / HorizontalResolution
I then draw a rectangle:
oGdPictureImaging.DrawRectangle(ImageID, PixLeft, PixTop, PixWidth, PixHeight, 10, Color.Red, True)
Now when I reposition the annotation with these fixures, it is where it should be. But if draw a rectangle on this image using these figures, the rectangle is off to the left and slighly down. It is not in the same position as the Annotation. Now the GD Viewer has functionality that enables you to select what area you want to process. But using the Rectangle Annotation provides a really nice way of enabling the user to edit the size and position of the area. So I am trying to integrate the two so that I can then process the area selected.
So my question is, how do I translate the position of the Annotations so that I get an accurate rectangle on the image?