Graphics::D rawPolygon(constPen*,constPoint*,INT) 메서드(gdiplusgraphics.h)

Graphics::D rawPolygon 메서드는 다각형을 그립니다.

구문

Status DrawPolygon(
  [in] const Pen   *pen,
  [in] const Point *points,
  [in] INT         count
);

매개 변수

[in] pen

형식: const *

다각형을 그리는 데 사용되는 펜에 대한 포인터입니다.

[in] points

형식: const Point*

다각형의 꼭짓점을 지정하는 Point 개체의 배열에 대한 포인터입니다.

[in] count

형식: INT*

배열의 요소 수를 지정하는 정수입니다.

반환 값

형식: 상태

메서드가 성공하면 Status 열거형의 요소인 Ok를 반환합니다.

메서드가 실패하면 Status 열거형의 다른 요소 중 하나를 반환합니다.

설명

배열의 첫 번째 좌표와 마지막 좌표가 동일하지 않으면 점 배열 사이에 선이 그려져 다각형을 닫습니다.

예제

다음 예제에서는 점 배열로 정의된 다각형을 그립니다.

VOID Example_DrawPolygon(HDC hdc)
{
   Graphics graphics(hdc);

   // Create a Pen object.
   Pen blackPen(Color(255, 0, 0, 0), 3);

   // Create an array of Point objects that define the polygon.
   Point point1(100, 100);
   Point point2(200, 130);
   Point point3(150, 200);
   Point point4(50, 200);
   Point point5(0, 130);
   Point points[5] = {point1, point2, point3, point4, point5};
   Point* pPoints = points;

   // Draw the polygon.
   graphics.DrawPolygon(&blackPen, pPoints, 5);
}

요구 사항

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

참고 항목

FillPolygon 메서드

그래픽

Point

다각형