Using Win32 functions in Visual FoxPro Image Gallery
Coordinate Space and Transformation
..msdn
ClientToScreen
DPtoLP
GetGraphicsMode
GetMapMode
GetWorldTransform
LPtoDP
ScreenToClient
SetGraphicsMode
SetMapMode
Code examples:
DPtoLP
..msdn    Add comment     W32 Constants      Translate this page
Converts device coordinates into logical coordinates.
Code examples:
Declaration:
BOOL DPtoLP(
    HDC hdc,           // handle to device context
    LPPOINT lpPoints,  // array of points
    int nCount         // count of points in array
);
FoxPro declaration:
DECLARE INTEGER DPtoLP IN gdi32;
    INTEGER hdc,;
    STRING @lpPoints,;
    INTEGER nCount
Parameters:
hdc
[in] Handle to the device context.

lpPoints
[in/out] Pointer to an array of POINT structures. The x- and y-coordinates contained in each POINT structure will be transformed.

nCount
[in] Specifies the number of points in the array.
Return value:
If the function succeeds, the return value is nonzero.
My comment:
The conversion depends on the mapping mode of the device context, the settings of the origins and extents for the window and viewport, and the world transformation.

LOCAL hWindow, hDC, cBuffer
hWindow = _screen.HWnd
hDC = GetWindowDC(hWindow)

cBuffer = num2dword(100) + num2dword(100)
? DPtoLP(hDC, @cBuffer, 1)

? buf2dword(SUBSTR(cBuffer,1,4)),;
        buf2dword(SUBSTR(cBuffer,5,4))

= ReleaseDC(hWindow, hDC)


See also: LPtoDP
Word Index links for the DPtoLP :
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
Created: 2007-04-27 13:00:32
Modified: 2007-04-27 13:03:27
Visited in last 7 days: 4
User Contributed Notes:
There are no notes on this subject.


Copyright 2001-2017 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

Privacy policy
Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.6.37), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (54.166.150.10)
6 sec.Function: 'CeDeleteDatabase'
11 sec.Function: 'SQLExecDirect'
17 sec.Function: 'SCardStatus'
23 sec.Function: 'GetThreadLocale'
29 sec.Function: 'GetMenuContextHelpId'
35 sec.Function: 'mmioWrite'
40 sec.
Function group: 'Windows Multimedia'
47 sec.
Function group: 'Brush'
53 sec.Function: 'CommitTransaction'
1 min.Function: 'CeRapiInitEx'
Google
Advertise here!