Click or drag to resize

PdfiumFPDF_DeviceToPage Method

Convert the screen coordinate of a point to page coordinate.

Namespace: Patagames.Pdf
Assembly: Patagames.Pdf (in Patagames.Pdf.dll) Version: 4.94.2704
Syntax
public static void FPDF_DeviceToPage(
	IntPtr page,
	int start_x,
	int start_y,
	int size_x,
	int size_y,
	PageRotate rotate,
	int device_x,
	int device_y,
	out double page_x,
	out double page_y
)

Parameters

page  IntPtr
Handle to the page. Returned by FPDF_LoadPage(IntPtr, Int32) function.
start_x  Int32
Left pixel position of the display area in the device coordinate
start_y  Int32
Top pixel position of the display area in the device coordinate
size_x  Int32
Horizontal size (in pixels) for displaying the page
size_y  Int32
Vertical size (in pixels) for displaying the page
rotate  PageRotate
Page orientation: 0 (normal), 1 (rotated 90 degrees clockwise),2 (rotated 180 degrees), 3 (rotated 90 degrees counter-clockwise).
device_x  Int32
X value in device coordinate, for the point to be converted
device_y  Int32
Y value in device coordinate, for the point to be converted
page_x  Double
A pointer to a double value receiving the converted X value in page coordinate
page_y  Double
A pointer to a double value receiving the converted Y value in page coordinate
Remarks
The page coordinate system has its origin at left-bottom corner of the page, with X axis goes along the bottom side to the right, and Y axis goes along the left side upward. NOTE: this coordinate system can be altered when you zoom, scroll, or rotate a page, however, a point on the page should always have the same coordinate values in the page coordinate system. The device coordinate system is device dependant. For screen device, its origin is at left-top corner of the window. However this origin can be altered by Windows coordinate transformation utilities. You must make sure the start_x, start_y, size_x, size_y and rotate parameters have exactlysame values as you used in FPDF_RenderPage(IntPtr, IntPtr, Int32, Int32, Int32, Int32, PageRotate, RenderFlags) function call.
See Also