TRectEmpty (C++)

From RAD Studio Code Examples
Jump to: navigation, search

Description

This example illustrates how to use the Empty method to create an empty rectangle, with the upper-left corner and the lower-right corner both in the point (0, 0).

Code

#include <tchar.h>
#include <stdio.h>
#include <system.types.hpp>

int _tmain(int argc, _TCHAR* argv[])
{
	TRect *aRectangle = new TRect();
	aRectangle->Empty();
	printf("%d %d %d %d\n",aRectangle->Left,aRectangle->Top,aRectangle->Right,aRectangle->Bottom);
        // The console will output: 0 0 0 0, representing the coordinates of the corners of aRectangle

	return 0;
}

Uses