Size::operator+ 메서드(gdiplustypes.h)

Size::operator+ 메서드는 두 Size 개체의 WidthHeight 데이터 멤버를 추가합니다.

구문

Size operator+(
  [in, ref] const Size & sz
);

매개 변수

[in, ref] sz

형식: const Size

WidthHeight 데이터 멤버가 이 Size 개체의 WidthHeight 데이터 멤버에 추가되는 Size 개체에 대한 참조입니다.

반환 값

형식: 크기

이 메서드는 이 Size 개체와 다른 Size 개체의 합계를 반환합니다.

설명

이 메서드는 Size 개체에 대한 더하기 연산자를 오버로드합니다. A, B 및 C가 Size 개체인 경우 C = A + B 문은 C = A.operator+(B)와 동일합니다.

예제

VOID Example_OperatorPlus(HDC hdc)
{
   Graphics graphics(hdc);
   Pen pen(Color(255, 0, 0, 0));

   Size size1(80, 30);
   Size size2(50, 20);
   
   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);
}

요구 사항

   
지원되는 최소 클라이언트 Windows XP, Windows 2000 Professional [데스크톱 앱만 해당]
지원되는 최소 서버 Windows 2000 Server[데스크톱 앱만]
대상 플랫폼 Windows
헤더 gdiplustypes.h(Gdiplus.h 포함)
라이브러리 Gdiplus.lib
DLL Gdiplus.dll

참고 항목

크기

Size::operator-

Sizef