Jump to content

GpiRectVisible: Difference between revisions

From EDM2
Created page with "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 (LON..."
 
Ak120 (talk | contribs)
mNo edit summary
 
Line 5: Line 5:


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


==Return Value==
==Return Value==
; lVisibility ([[LONG]]) - returns
; lVisibility ([[LONG]]) - returns: Visibility indicator.
: Visibility indicator.
:: RVIS_INVISIBLE : Not visible
:; RVIS_INVISIBLE
:: RVIS_PARTIAL : Some of the rectangle is visible
:: Not visible
:: RVIS_VISIBLE : All of the rectangle is visible
:; RVIS_PARTIAL
:: RVIS_ERROR : Error.
:: Some of the rectangle is visible
:; RVIS_VISIBLE
:: All of the rectangle is visible
:; RVIS_ERROR
:: Error.


==Remarks==
==Remarks==
Line 29: Line 21:
==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_RECT (0x20BD): An invalid rectangle parameter was specified.
; PMERR_INV_COORDINATE (0x205B)
: An invalid coordinate value was specified.
; PMERR_INV_RECT (0x20BD)
: An invalid rectangle parameter 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. */
PRECTL  prclRectangle; /* Test rectangle, in world coordinates. */
LONG    lVisibility;  /* Visibility indicator. */
lVisibility = GpiRectVisible(hps, prclRectangle);
</PRE>
In this example the GpiRectVisible call is used to determine if all of the rectangle is visible.
In this example the GpiRectVisible call is used to determine if all of the rectangle is visible.
<pre>
<pre>
#define INCL_GPIPRIMITIVES
#define INCL_GPIPRIMITIVES
#include &lt;OS2.H&gt;
#include <OS2.H>


HPS hps; /* presentation-space handle. */
HPS hps; /* presentation-space handle. */
Line 64: Line 40:


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

Latest revision as of 21:33, 17 November 2025

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