Hello,
I encountered a new problem with the GdPicture-Library. I recently updated GdPicture.NET because of a bug with the GdViewer. But now there occured another problem, where it did work before updating.
I've got my Form with a GdViewer control on it. When the MouseMove event of this control fires, a label below the control shows the coordinates. I get these by using the GdViewer.GetMouseLeftInDocument() and GdViewer.GetMouseTopInDocument() methods. Before the update, these coordinates did not vary when zooming. Now, when zooming, the documents maximum right and bottom coordinate changes. (I tested this by zooming and checking the right bottom coordinate after each zoom step)
Another thing i noticed is, that not only the coordinates change when zooming, but also the HorizontalResolution and VerticalResolution properties.
I tried to convert them by using the CoordDocumentToViewer() and CoordViewerToDocument() methods, but this isn't working either.
How can i get the absolute coordinates of the mouse on the document with ignoring the current zoom level?
Regards,
prosigma
Problem with GdViewer coordinates
Re: Problem with GdViewer coordinates
Hi,
I suppose you are viewing PDF. This behavior is not a bug and was exactly the same in all previous versions.
A PDF document is not a raster bitmap. So you have to get coordinates in Inches.
You can do that easily:
Hope this helps.
Kind regards,
Loïc
I suppose you are viewing PDF. This behavior is not a bug and was exactly the same in all previous versions.
A PDF document is not a raster bitmap. So you have to get coordinates in Inches.
You can do that easily:
Code: Select all
X = GdViewer.GetMouseLeftInDocument / GdViewer.HorizontalResolution
Y = GdViewer.GetMouseTopInDocument / GdViewer.VerticalResolution
Kind regards,
Loïc
Re: Problem with GdViewer coordinates
Thanks,
it was actually a PDF when i thought it was a TIFF. And with the TIFF it works well as before.
When loading a PDF file i now render it first and load this image again into the GdViewer, then i have the coordinates the same format as with TIFF.
Apart from that, thanks alot for the quick reply!
Regards,
prosigma
it was actually a PDF when i thought it was a TIFF. And with the TIFF it works well as before.
When loading a PDF file i now render it first and load this image again into the GdViewer, then i have the coordinates the same format as with TIFF.
Apart from that, thanks alot for the quick reply!
Regards,
prosigma
Who is online
Users browsing this forum: No registered users and 1 guest