Jump to content

GpiPtVisible

From EDM2

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