Jump to content

GpiRectVisible

From EDM2

This function checks whether any part of a rectangle lies within the clipping region of the device associated with the specified presentation space.

Syntax

GpiRectVisible(hps, prclRectangle)

Parameters

hps (HPS) - input
Presentation-space handle.
prclRectangle (PRECTL) - input
Test rectangle, in world coordinates.
Points on the borders of the rectangle are considered to be included within the rectangle.

Return Value

lVisibility (LONG) - returns
Visibility indicator.
RVIS_INVISIBLE : Not visible
RVIS_PARTIAL : Some of the rectangle is visible
RVIS_VISIBLE : All of the rectangle is visible
RVIS_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.
PMERR_INV_RECT (0x20BD)
An invalid rectangle parameter was specified.

Example Code

In this example the GpiRectVisible call is used to determine if all of the rectangle is visible.

#define INCL_GPIPRIMITIVES
#include <OS2.H>

HPS hps; /* presentation-space handle. */
LONG lVisibility; /* visibility indicator */
PRECTL prclRectangle; /* test rectangle in world */
                      /* coordinates. */

lVisibility = GpiRectVisible(hps, prclRectangle);

if (lVisibility == RVIS_INVISIBLE) /* rectangle is not */
{                                  /* visible. */
  /* code block */
}

Related Functions