GraphicsPath::GetPointCount 메서드(gdipluspath.h)

GraphicsPath::GetPointCount 메서드는 이 경로의 데이터 요소 배열에 있는 점 수를 가져옵니다. 이는 경로의 점 형식 배열에 있는 형식 수와 동일합니다.

구문

INT GetPointCount();

반환 값

형식: INT

이 메서드는 경로의 데이터 요소 배열에 있는 점 수를 반환합니다.

설명

GraphicsPath 개체에는 점 배열과 형식 배열이 있습니다. 형식 배열의 각 요소는 점 형식을 지정하는 바이트 및 점 배열의 해당 요소에 대한 플래그 집합입니다. 가능한 점 유형 및 플래그는 PathPointType 열거형에 나열됩니다.

예제

다음 예제에서는 줄임표를 하나와 한 줄이 있는 경로를 만듭니다. 이 코드는 GraphicsPath::GetPointCount 메서드를 호출하여 경로에 저장된 데이터 요소 수를 확인합니다. 그런 다음, 코드는 GraphicsPath::GetPathPoints 메서드를 호출하여 해당 데이터 요소를 검색합니다. 마지막으로 코드는 각 데이터 요소에 작은 줄임표를 채웁니다.

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

   // Create a path that has one ellipse and one line.
   GraphicsPath path;
   path.AddEllipse(10, 10, 200, 100);
   path.AddLine(220, 120, 300, 160);

   // Find out how many data points are stored in the path.
   INT count = path.GetPointCount();

   // Draw the path points.
   SolidBrush redBrush(Color(255, 255, 0, 0));
   PointF* points = new PointF[count];
   path.GetPathPoints(points, count);

   for(INT j = 0; j < count; ++j)
      graphics.FillEllipse(
         &redBrush, 
         points[j].X - 3.0f, 
         points[j].Y - 3.0f, 
         6.0f, 
         6.0f); 

   delete [] points; 
} 

요구 사항

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

참고 항목

지역을 사용하여 클리핑

경로 구성 및 그리기

경로 그라데이션 만들기

GetPathPoints 메서드

Graphicspath

GraphicsPath::GetPathData

GraphicsPath::GetPathTypes

PathData

PathPointType

경로