Size.operator-(const Size) method
Applies to: desktop apps only
The Size::operator- method subtracts the Width and Height data members of two Size objects.
Syntax
Size operator-(
[in, ref] const Size &sz
);
Parameters
sz [in, ref]
Type: const SizeReference to a Size object whose Width and Height data members are subtracted from the Width and Height data members of this Size object.
Return value
Type:
Type: Size****
This method returns the difference of this Size object and another Size object.
Remarks
This method overloads the subtraction operator for Size objects. If A, B, and C are Size objects, the statement C = A - B is equivalent to C = A.operator-(B).
Examples
VOID Example_OperatorMinus(HWND hWnd)
{
Graphics graphics(hdc);
Pen pen(Color(255, 0, 0, 0));
Size size1(200, 100);
Size size2(50, 40);
Size size3 = size1 - size2;
graphics.DrawRectangle(&pen, 50, 50, size1.Width, size1.Height);
graphics.DrawRectangle(&pen, 50, 50, size2.Width, size2.Height);
graphics.DrawRectangle(&pen, 50, 50, size3.Width, size3.Height);
}
Requirements
Minimum supported client |
Windows XP, Windows 2000 Professional |
Minimum supported server |
Windows 2000 Server |
Product |
GDI+ 1.0 |
Header |
Gdiplustypes.h (include Gdiplus.h) |
Library |
Gdiplus.lib |
DLL |
Gdiplus.dll |
See also
Send comments about this topic to Microsoft
Build date: 3/6/2012