UnionRect (C++)

From RAD Studio Code Examples
Jump to: navigation, search

Description

The following code example illustrates the usage of the UnionRect function.

Code

#include <System.Types.hpp>

int _tmain(int argc, _TCHAR* argv[]) {
	TRect *aRectangle = new TRect(4, 8, 25, 36);
	TRect *aRectangle2 = new TRect(51, 48, 30, 44);
	TRect *resultRect = new TRect();

	if (UnionRect(resultRect, aRectangle, aRectangle2)) 
		printf("An union between aRectangle and aRectangle2 exists!");
	else
		printf("The width or height of the resulting triangle is less than or equal to 0!");
	getchar();
	return 0;
}

Uses