[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
_gtRectSize()
Determine the buffer size needed to save a specified screen region
------------------------------------------------------------------------------
C Prototype
#include "gt.api"
ERRCODE _gtRectSize(
USHORT uiTop,
USHORT uiLeft,
USHORT uiBottom,
USHORT uiRight,
USHORTP uipBuffSize
)
Arguments
uiTop, uiLeft, uiBottom, and uiRight define the coordinates
of the rectangular region to be calculated. If all coordinates are
NULL, the entire display region is used.
uipBuffSize is the size of the buffer needed to contain the
specified region.
Returns
_gtRectSize() returns zero if successful. Any other value indicates an
error.
Description
_gtRectSize() analyzes the specified screen region, determines the
buffer size needed to save it, and saves the buffer size as a numeric
value.
Examples
. This example uses _gtRectSize() to calculate the memory needed
by _xvalloc() (see the "Virtual Memory API Reference" chapter of this
guide) to properly save the screen buffer:
#include "gt.api"
#include "vm.api"
.
.
.
BYTEP psBuff;
USHORT uiBuffSize;
HANDLE hVM;
_gtRectSize( 1, 1, 10, 25, &uiBuffSize );
hVM = _xvalloc( uiBuffSize, 0 );
scrBuff = _xvlock( hVM );
_gtSave( 1, 1, 10, 25, fpBuff ); // Save area under rect
.
. <manipulate screen>
.
_gtRest( 1, 1, 10, 25, fpBuff ); // Restore screen
_xvunlock( hVM );
_xvfree( hVM );
.
.
.
Files Library is CLIPPER.LIB, header file is Gt.api.
See Also:
_gtRest()
_gtSave()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson