MultiplyRect (C++)

From RAD Studio Code Examples
Jump to: navigation, search

Description

The following code example illustrates the usage of the MultiplyRect routine.

Code

#include <System.Types.hpp>

int _tmain(int argc, _TCHAR* argv[])
{
	TRectF* aRectangle = new TRectF(2,4,7,8);

	MultiplyRect(*aRectangle, 1.0, 2.0);

	/* New values of coordinates:
	Left = 2*1 ; Top = 4*2; Right = 7*1; Bottom = 8*2.
	*/
	printf("Left:%f Top:%f Right:%f Bottom:%f", aRectangle->Left, aRectangle->Top, aRectangle->Right, aRectangle->Bottom);
	return 0;
}

Note: The coordinates of the plan start in the upper-left corner of the screen from (0,0).

Uses