GpiSetPatternRefPoint: Difference between revisions
Line 5: | Line 5: | ||
==Parameters== | ==Parameters== | ||
;hps (HPS) - input : Presentation-space handle. | ;hps ([[HPS]]) - input : Presentation-space handle. | ||
;pptlRefPoint ( | ;pptlRefPoint (P[[POINTL]]) - input : Pattern reference point. | ||
:The coordinates are world coordinates. | :The coordinates are world coordinates. | ||
Latest revision as of 23:30, 7 April 2025
This function sets the current pattern reference point to the specified value.
Syntax
GpiSetPatternRefPoint (hps, pptlRefPoint)
Parameters
- hps (HPS) - input
- Presentation-space handle.
- pptlRefPoint (PPOINTL) - input
- Pattern reference point.
- The coordinates are world coordinates.
Return Code
- rc (BOOL) - returns
- Success indicator.
- TRUE Successful completion
- FALSE Error occurred.
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_COORDINATE (0x205B)
- An invalid coordinate value was specified.
Remarks
The pattern reference point is the point to which the origin of the area filling pattern maps. The pattern is mapped into the area to be filled by conceptually replicating the pattern definition in a horizontal and vertical direction.
Because the pattern reference point is subject to all of the transforms, if an area is moved by changing a transform and redrawing, the fill pattern also appears to move, so as to retain its position relative to the area boundaries. The pattern reference point, which is specified in world coordinates, need not be inside the actual area to be filled. The pattern reference point is not subject to clipping.
This function must not be issued in an area or path bracket.
The attribute mode (see GpiSetAttrMode) determines whether the current value of the pattern reference point is preserved.
The initial default pattern reference point is (0,0). This can be changed with GpiSetDefAttrs.
Graphic Elements and Orders
- Element Type
- OCODE_GSPRP : This element type is generated if the attribute mode (see GpiSetAttrMode) is set to AM_NOPRESERVE.
- Order: Set Pattern Reference Point
- Element Type
- OCODE_GPSPRP : This element type is generated if the attribute mode is set to AM_PRESERVE.
- Order: Push and Set Pattern Reference Point
Example Code
This function sets the current pattern reference point to the specified value.
#define INCL_GPIPRIMITIVES #include <OS2.H> HPS hps; /* Presentation-space */ /* handle. */ POINTL ptlRefPoint = {0,0}; GpiSetPatternRefPoint(hps, &ptlRefPoint);