Jump to content

GpiSetPatternRefPoint: Difference between revisions

From EDM2
Created page with "This function sets the current pattern reference point to the specified value. ==Syntax== <PRE> #define INCL_GPIPRIMITIVES Or use INCL_GPI, INCL_PM,: #include <os2.h> H..."
 
Ak120 (talk | contribs)
mNo edit summary
Line 2: Line 2:


==Syntax==
==Syntax==
<PRE>
GpiSetPatternRefPoint (hps, pptlRefPoint)
#define INCL_GPIPRIMITIVES /* Or use INCL_GPI, INCL_PM, */
#include <os2.h>
 
HPS          hps;            /* Presentation-space handle. */
PPOINTL      pptlRefPoint;  /* Pattern reference point. */
BOOL        rc;            /* Success indicator. */
 
rc = GpiSetPatternRefPoint(hps, pptlRefPoint);
</PRE>
</PRE>
==Parameters==
==Parameters==
; hps (HPS) - input : Presentation-space handle.
;hps (HPS) - input : Presentation-space handle.
 
;pptlRefPoint (PPOINTL) - input : Pattern reference point.
; pptlRefPoint (PPOINTL) - input : Pattern reference point.
:The coordinates are world coordinates.
The coordinates are world coordinates.


==Return Code==
==Return Code==
; rc (BOOL) - returns : Success indicator.
;rc (BOOL) - returns : Success indicator.
* TRUE Successful completion
*TRUE Successful completion
* FALSE Error occurred.
*FALSE Error occurred.


==Errors==  
==Errors==  
Possible returns from WinGetLastError
Possible returns from WinGetLastError
; PMERR_INV_HPS (0x207F) : An invalid presentation-space handle was specified.
; 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_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.
; PMERR_INV_COORDINATE (0x205B) : An invalid coordinate value was specified.


Line 45: Line 33:


==Graphic Elements and Orders==
==Graphic Elements and Orders==
; Element Type: OCODE_GSPRP : This element type is generated if the attribute mode (see GpiSetAttrMode) is set to AM_NOPRESERVE.
;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
:Order: Set Pattern Reference Point
 
;Element Type: OCODE_GPSPRP : This element type is generated if the attribute mode is set to AM_PRESERVE.
; 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
Order: Push and Set Pattern Reference Point


==Example Code==
==Example Code==
Line 69: Line 56:
* [[GpiEndArea]]
* [[GpiEndArea]]
* [[GpiQueryPatternRefPoint]]
* [[GpiQueryPatternRefPoint]]
* [[GpiSetAttrMode]]
*GpiSetAttrMode
* [[GpiSetAttrs]]
*GpiSetAttrs
* [[GpiSetDefAttrs]]
*GpiSetDefAttrs
* [[GpiSetPattern]]
* [[GpiSetPattern]]
* [[GpiSetPatternSet]]
* [[GpiSetPatternSet]]


[[Category:Gpi]]
[[Category:Gpi]]

Revision as of 16:37, 6 March 2017

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);

Related Functions