Jump to content

GpiPtVisible: Difference between revisions

From EDM2
Created page with "This function checks whether a point is visible within the clipping region of the device associated with the specified presentation space. ==Syntax== GpiPtVisible(hps, pptlPoint) ==Parameters== ; hps (HPS) - input : Presentation-space handle. ; pptlPoint (PPOINTL) - input : Point to be checked. : The point is given in world coordinates. ==Return Value== ; lVisibility (LONG) - returns : Visibility indicator. :; PVIS_INVISIBLE :: Not visible :; PVIS_VISIBL..."
 
Ak120 (talk | contribs)
mNo edit summary
 
Line 5: Line 5:


==Parameters==
==Parameters==
; hps ([[HPS]]) - input
; hps ([[HPS]]) - input: Presentation-space handle.
: Presentation-space handle.
; pptlPoint ([[PPOINTL]]) - input: Point to be checked.
 
; pptlPoint ([[PPOINTL]]) - input
: Point to be checked.
: The point is given in world coordinates.
: The point is given in world coordinates.


==Return Value==
==Return Value==
; lVisibility ([[LONG]]) - returns
; lVisibility ([[LONG]]) - returns: Visibility indicator.
: Visibility indicator.
:: PVIS_INVISIBLE - Not visible
:; PVIS_INVISIBLE
:: PVIS_VISIBLE - Visible
:: Not visible
:: PVIS_ERROR - Error.
:; PVIS_VISIBLE
:: Visible
:; PVIS_ERROR
:: Error.


==Remarks==
==Remarks==
Line 27: Line 20:
==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_COORDINATE (0x205B): An invalid coordinate value was specified.
: 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.


==Example Code==
==Example Code==
<PRE>
#define INCL_GPIPRIMITIVES /* Or use INCL_GPI, INCL_PM, */
#include &lt;os2.h&gt;
HPS    hps;      /* Presentation-space handle. */
PPOINTL pptlPoint; /* Point to be checked. */
LONG    lVisibility; /* Visibility indicator. */
lVisibility = GpiPtVisible(hps, pptlPoint);
</PRE>
This example uses GpiPtVisible to check whether (150,150) is visible within the clipping region of the device associated with the presentation space.
This example uses GpiPtVisible to check whether (150,150) is visible within the clipping region of the device associated with the presentation space.
<pre>
<pre>
#define INCL_GPIPRIMITIVES /* Primitive functions */
#define INCL_GPIPRIMITIVES /* Primitive functions */
#include &lt;os2.h&gt;
#include <os2.h>


LONG lVisibility; /* visibility indicator */
LONG   lVisibility; /* visibility indicator */
HPS hps; /* Presentation-space handle */
HPS   hps;         /* Presentation-space handle */
POINTL pptlPoint = {150L,150L};/* point to be checked */
POINTL pptlPoint = {150L,150L};/* point to be checked */



Latest revision as of 23:43, 16 November 2025

This function checks whether a point is visible within the clipping region of the device associated with the specified presentation space.

Syntax

GpiPtVisible(hps, pptlPoint)

Parameters

hps (HPS) - input
Presentation-space handle.
pptlPoint (PPOINTL) - input
Point to be checked.
The point is given in world coordinates.

Return Value

lVisibility (LONG) - returns
Visibility indicator.
PVIS_INVISIBLE - Not visible
PVIS_VISIBLE - Visible
PVIS_ERROR - Error.

Remarks

For the purposes of this function, the clipping region is defined as the intersection between the application clipping region, and any other clipping, including windowing.

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.

Example Code

This example uses GpiPtVisible to check whether (150,150) is visible within the clipping region of the device associated with the presentation space.

#define INCL_GPIPRIMITIVES /* Primitive functions */
#include <os2.h>

LONG   lVisibility; /* visibility indicator */
HPS    hps;         /* Presentation-space handle */
POINTL pptlPoint = {150L,150L};/* point to be checked */

lVisibility = GpiPtVisible(hps, &pptlPoint);

Related Functions