IUIX_Obj::ScreenPtToClient Method
From PDF XChange PDF SDK
m (Automatic page editing by robot) |
|||
(4 intermediate revisions by one other user not shown) | |||
Line 2: | Line 2: | ||
[[Category:Editor]] | [[Category:Editor]] | ||
{{#customTitle:IUIX_Obj::ScreenPtToClient Method}} | {{#customTitle:IUIX_Obj::ScreenPtToClient Method}} | ||
− | {{#parentPage:PXV:IUIX_Obj#Methods|ScreenPtToClient | + | {{#parentPage:PXV:IUIX_Obj#Methods|ScreenPtToClient|method}} |
− | + | ||
{{ToReview}} | {{ToReview}} | ||
− | + | Converts point from screen coordinates to the Control coordinates. | |
== Syntax == | == Syntax == | ||
− | <pre class="brush:cpp;gutter:false">HRESULT ScreenPtToClient([in] POINT* | + | <pre class="brush:cpp;gutter:false">HRESULT ScreenPtToClient([in] POINT* stScreen, |
− | [out] POINT* | + | [out] POINT* stClient);</pre> |
== Parameters == | == Parameters == | ||
− | ; | + | ;stScreen |
− | :[in] Pointer to POINT. | + | :[in] Pointer to POINT containing the screen coordinates. |
− | ; | + | ;stClient |
− | :[out] Pointer to POINT. | + | :[out] Pointer to POINT containing the resulting Control coordinates. |
== Return Value == | == Return Value == | ||
Returns S_OK if operation was successful or error code in other cases. | Returns S_OK if operation was successful or error code in other cases. | ||
+ | |||
+ | == Sample == | ||
+ | <pre class="brush:c#">//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); | ||
+ | } | ||
+ | </pre> | ||
== See Also == | == See Also == | ||
[[PXV:IUIX_Obj|IUIX_Obj]] | [[PXV:IUIX_Obj|IUIX_Obj]] |
Latest revision as of 23:40, 21 April 2016
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); }