IUIX_Obj::ScreenPtToClient Method
From PDF XChange PDF SDK
Converts point from screen coordinates to the Control coordinates.
Syntax
HRESULT ScreenPtToClient([in] POINT* stScreen, [out] POINT* stClient);
Parameters
- stScreen
- [in] Pointer to POINT containing the screen coordinates.
- stClient
- [out] Pointer to POINT containing the resulting Control coordinates.
Return Value
Returns S_OK if operation was successful or error code in other cases.
Sample
//C# public int HitTestPage(PDFXEdit._POINTL pt, out PDFXEdit.PXC_Point ptPagePoint) { //Converting input data into given structures PDFXEdit.tagPOINT ptIn = new PDFXEdit.tagPOINT(); ptIn.x = pt.x; ptIn.y = pt.y; PDFXEdit.tagPOINT ptRes = new PDFXEdit.tagPOINT(); //Converting screen point to PDFXEdit client point pdfCtl.Doc.ActiveView.PagesView.Obj.ScreenPtToClient(ptIn, out ptRes); //And then checking whether it is on page and returning it in page coordinate system if so return pdfCtl.Doc.ActiveView.PagesView.Layout.HitTest(ptRes, out ptPagePoint); }