GpiOffsetRegion: Difference between revisions
Appearance
Created page with "This function moves a region. ==Syntax== GpiOffsetRegion(hps, Hrgn, pptlOffset) ==Parameters== ; hps (HPS) - input : Presentation-space handle. : The region must be owned by the device identified by the currently associated device context. ; Hrgn (HRGN) - input : Handle of the region to be moved. ; pptlOffset (PPOINTL) - input : Offset to be added to the region boundary. ==Return Value== ; rc (BOOL) - returns : Success indicator. :; TRUE :: Successf..." |
mNo edit summary |
||
| Line 5: | Line 5: | ||
==Parameters== | ==Parameters== | ||
; hps ([[HPS]]) - input | ; hps ([[HPS]]) - input: Presentation-space handle. | ||
: Presentation-space handle. | |||
: The region must be owned by the device identified by the currently associated device context. | : The region must be owned by the device identified by the currently associated device context. | ||
; Hrgn ([[HRGN]]) - input: Handle of the region to be moved. | |||
; Hrgn ([[HRGN]]) - input | ; pptlOffset ([[PPOINTL]]) - input: Offset to be added to the region boundary. | ||
: Handle of the region to be moved. | |||
; pptlOffset ([[PPOINTL]]) - input | |||
: Offset to be added to the region boundary. | |||
==Return Value== | ==Return Value== | ||
; rc ([[BOOL]]) - returns | ; rc ([[BOOL]]) - returns: Success indicator. | ||
: Success indicator. | ::TRUE : Successful completion | ||
: | ::FALSE : Error occurred. | ||
: | |||
==Remarks== | ==Remarks== | ||
| Line 29: | Line 21: | ||
==Errors== | ==Errors== | ||
Possible returns from WinGetLastError: | Possible returns from WinGetLastError: | ||
; PMERR_INV_HPS (0x207F) | ; PMERR_INV_HPS (0x207F): An invalid presentation-space handle was specified. | ||
: An invalid presentation-space handle was specified. | ; PMERR_PS_BUSY (0x20F4): An attempt was made to access the presentation space from more than one thread simultaneously. | ||
; PMERR_PS_BUSY (0x20F4) | ; PMERR_INV_HRGN (0x2080): An invalid region handle was specified. | ||
: An attempt was made to access the presentation space from more than one thread simultaneously. | ; PMERR_REGION_IS_CLIP_REGION (0x20F8): An attempt was made to perform a region operation on a region that is selected as a clip region. | ||
; PMERR_INV_HRGN (0x2080) | ; PMERR_INV_COORDINATE (0x205B): An invalid coordinate value was specified. | ||
: An invalid region handle was specified. | ; PMERR_HRGN_BUSY (0x2034): An internal region busy error was detected. The region was locked by one thread during an attempt to access it from another thread. | ||
; PMERR_REGION_IS_CLIP_REGION (0x20F8) | |||
: An attempt was made to perform a region operation on a region that is selected as a clip region. | |||
; PMERR_INV_COORDINATE (0x205B) | |||
: An invalid coordinate value was specified. | |||
; PMERR_HRGN_BUSY (0x2034) | |||
: An internal region busy error was detected. The region was locked by one thread during an attempt to access it from another thread. | |||
==Example Code== | ==Example Code== | ||
This example uses GpiOffsetRegion to move a region right by 3 and up by 3. | This example uses GpiOffsetRegion to move a region right by 3 and up by 3. | ||
<pre> | <pre> | ||
#define INCL_GPIREGIONS /* Region functions */ | #define INCL_GPIREGIONS /* Region functions */ | ||
#include | #include <os2.h> | ||
BOOL fSuccess; /* success indicator */ | BOOL fSuccess; /* success indicator */ | ||
Latest revision as of 00:40, 24 November 2025
This function moves a region.
Syntax
GpiOffsetRegion(hps, Hrgn, pptlOffset)
Parameters
- hps (HPS) - input
- Presentation-space handle.
- The region must be owned by the device identified by the currently associated device context.
- Hrgn (HRGN) - input
- Handle of the region to be moved.
- pptlOffset (PPOINTL) - input
- Offset to be added to the region boundary.
Return Value
- rc (BOOL) - returns
- Success indicator.
- TRUE : Successful completion
- FALSE : Error occurred.
Remarks
This function moves the region to a new position. The new position is obtained by adding the value of pptlOffset to all the points that define the region boundary. An error is raised if the specified region is currently selected as the clip region (by GpiSetClipRegion).
Errors
Possible returns from WinGetLastError:
- PMERR_INV_HPS (0x207F)
- An invalid presentation-space handle was specified.
- PMERR_PS_BUSY (0x20F4)
- An attempt was made to access the presentation space from more than one thread simultaneously.
- PMERR_INV_HRGN (0x2080)
- An invalid region handle was specified.
- PMERR_REGION_IS_CLIP_REGION (0x20F8)
- An attempt was made to perform a region operation on a region that is selected as a clip region.
- PMERR_INV_COORDINATE (0x205B)
- An invalid coordinate value was specified.
- PMERR_HRGN_BUSY (0x2034)
- An internal region busy error was detected. The region was locked by one thread during an attempt to access it from another thread.
Example Code
This example uses GpiOffsetRegion to move a region right by 3 and up by 3.
#define INCL_GPIREGIONS /* Region functions */
#include <os2.h>
BOOL fSuccess; /* success indicator */
HPS hps; /* Presentation-space handle */
HRGN Hrgn; /* handle for region */
POINTL pptlOffset = {3,3}; /* displacement */
fSuccess = GpiOffsetRegion(hps, Hrgn, &pptlOffset);