function DeviceToPage(X, Y, Left, Top, Width, Height: Integer; Rotation: TRotation; out PageX, PageY: Double): Boolean;
| X, Y | Integer. The device-space coordinates of the point to convert (screen pixels, origin at top-left). |
| Left, Top, Width, Height | Integer. The rendering rectangle that was passed to the corresponding RenderPage call. |
| Rotation | TRotation. İşleme sırasında kullanılan sayfa döndürmesi. Şuna geçirilen değerle eşleşmelidir RenderPage. |
| PageX, PageY | Double. Output parameters that receive the converted PDF user-space coordinates (origin at lower-left, units in points). |
True if the conversion succeeded, or False if it failed (for example, if no page is loaded).Bir noktayı cihaz alanından (ekran pikselleri) PDF kullanıcı alanına (points) dönüştürür. Bu yöntemi, işlenmiş bir sayfadaki fare tıklama konumunu PDF sayfasındaki karşılık gelen konuma çevirmek için kullanın.
PDF user space has its origin at the lower-left corner of the page, with the Y axis pointing upward. Device space has its origin at the top-left corner of the render rectangle, with the Y axis pointing downward.
The Left, Üst, Width, Height, and Rotation parameters must match exactly what was passed to the RenderPage call that produced the image being clicked on.
// Translate a mouse click on the painted page to PDF coordinates
procedure TForm1.PdfPanelMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var
PageX, PageY: Double;
begin
if Pdf.DeviceToPage(X, Y, 0, 0, PdfPanel.Width, PdfPanel.Height,
ro0, PageX, PageY) then
StatusBar1.SimpleText := Format('Page pos: %.1f, %.1f pt', [PageX, PageY]);
end;