GreGetDCOrigin: Difference between revisions
Appearance
Created page with "GreGetDCOrigin queries the origin of the device context that defines the bottom-left drawing origin for a display device or a banded hardcopy device. This function must be s..." |
mNo edit summary |
||
Line 1: | Line 1: | ||
GreGetDCOrigin queries the origin of the device context that defines the bottom-left drawing origin for a display device or a banded hardcopy device. | GreGetDCOrigin queries the origin of the device context that defines the bottom-left drawing origin for a display device or a banded hardcopy device. | ||
This function must be supported by presentation drivers for display devices and for hardcopy devices that use banding. For other devices, the minimum requirement is for the handling routine to return Successful with pptlOrigin set to (0,0). | This function must be supported by presentation drivers for display devices and for hardcopy devices that use banding. For other devices, the minimum requirement is for the handling routine to return Successful with pptlOrigin set to (0,0). | ||
;Simulation support: None. This function is mandatory for all drivers. | ;Simulation support: None. This function is mandatory for all drivers. | ||
==Syntax== | ==Syntax== | ||
GreGetDCOrigin(hdc, pptlOrigin, pInstance, lFunction) | GreGetDCOrigin(hdc, pptlOrigin, pInstance, lFunction) | ||
==Parameters== | ==Parameters== | ||
;hdc (HDC) - input | ;hdc (HDC) - input:Device context handle. | ||
:Device context handle. | ;pptlOrigin (PPOINTL) - input:Pointer to the (X,Y) coordinates of the returned DC origin in screen coordinates. | ||
;pInstance (PVOID) - input:Pointer to instance data. | |||
;pptlOrigin (PPOINTL) - input | ;lFunction (ULONG) - input:High-order WORD=flags; low-order WORD=NGreGetDCOrigin. | ||
:Pointer to the (X,Y) coordinates of the returned DC origin in screen coordinates. | |||
;pInstance (PVOID) - input | |||
:Pointer to instance data. | |||
;lFunction (ULONG) - input | |||
:High-order WORD=flags; low-order WORD=NGreGetDCOrigin. | |||
==Return Code== | ==Return Code== | ||
;rc (BOOL) - returns | ;rc (BOOL) - returns:Return Code. | ||
:Return Code. | :On completion, the handling routine must return a BOOLEAN value to indicate success or an error. | ||
:*TRUE Successful | |||
:*FALSE Error | |||
==Remarks== | |||
The DC origin is set by GreSetupDC (see GreSetupDC) at the graphics engine, and by GreDeviceSetDCOrigin (see GreDeviceSetDCOrigin) at the presentation driver. This device context origin is stored in the Device Context Instance (DCI) data structure addressed by pInstance. The DC origin is always returned in screen coordinates. | |||
==Sample Code== | ==Sample Code== | ||
<PRE> | <PRE> | ||
Line 42: | Line 34: | ||
BOOL rc; /* Return Code. */ | BOOL rc; /* Return Code. */ | ||
rc = GreGetDCOrigin(hdc, pptlOrigin, pInstance, | rc = GreGetDCOrigin(hdc, pptlOrigin, pInstance, lFunction); | ||
</PRE> | </PRE> | ||
[[Category:Gre]] | [[Category:Gre]] |
Latest revision as of 04:43, 24 March 2020
GreGetDCOrigin queries the origin of the device context that defines the bottom-left drawing origin for a display device or a banded hardcopy device.
This function must be supported by presentation drivers for display devices and for hardcopy devices that use banding. For other devices, the minimum requirement is for the handling routine to return Successful with pptlOrigin set to (0,0).
- Simulation support
- None. This function is mandatory for all drivers.
Syntax
GreGetDCOrigin(hdc, pptlOrigin, pInstance, lFunction)
Parameters
- hdc (HDC) - input
- Device context handle.
- pptlOrigin (PPOINTL) - input
- Pointer to the (X,Y) coordinates of the returned DC origin in screen coordinates.
- pInstance (PVOID) - input
- Pointer to instance data.
- lFunction (ULONG) - input
- High-order WORD=flags; low-order WORD=NGreGetDCOrigin.
Return Code
- rc (BOOL) - returns
- Return Code.
- On completion, the handling routine must return a BOOLEAN value to indicate success or an error.
- TRUE Successful
- FALSE Error
Remarks
The DC origin is set by GreSetupDC (see GreSetupDC) at the graphics engine, and by GreDeviceSetDCOrigin (see GreDeviceSetDCOrigin) at the presentation driver. This device context origin is stored in the Device Context Instance (DCI) data structure addressed by pInstance. The DC origin is always returned in screen coordinates.
Sample Code
#define INCL_GRE_DEVMISC3 #include <os2.h> HDC hdc; /* Device context handle. */ PPOINTL pptlOrigin; /* Pointer to the (X,Y) coordinates of the returned DC origin in screen coordinates. */ PVOID pInstance; /* Pointer to instance data. */ ULONG lFunction; /* High-order WORD=flags; low-order WORD=NGreGetDCOrigin. */ BOOL rc; /* Return Code. */ rc = GreGetDCOrigin(hdc, pptlOrigin, pInstance, lFunction);