Share via


GraphicsPathIterator::NextMarker(constGraphicsPath*) 메서드(gdipluspath.h)

GraphicsPathIterator::NextMarker 메서드는 이 반복기의 연결된 경로에 대한 다음 표식으로 구분된 섹션을 가져옵니다.

구문

INT NextMarker(
  [out] const GraphicsPath *path
);

매개 변수

[out] path

형식: GraphicsPath*

GraphicsPath 개체에 대한 포인터입니다. 이 메서드는 검색된 섹션의 데이터 요소와 일치하도록 이 GraphicsPath 개체의 데이터 요소를 설정합니다.

반환 값

형식: INT

이 메서드는 검색된 섹션의 데이터 포인트 수를 반환합니다. 검색할 표식으로 구분된 섹션이 더 이상 없으면 이 메서드는 0을 반환합니다.

설명

경로에는 선과 곡선을 정의하는 데이터 요소의 배열이 있습니다. 경로의 SetMarker 메서드를 호출하여 배열의 특정 지점을 표식으로 지정할 수 있습니다. 이러한 표식 지점은 경로를 섹션으로 나눕니다.

반복 기의 GraphicsPathIterator::NextMarker 메서드를 처음 호출할 때 해당 반복기의 연결된 경로에 대한 첫 번째 표식으로 구분된 섹션을 가져옵니다. 두 번째로 두 번째 섹션을 가져옵니다. GraphicsPathIterator::NextSubpath를 호출할 때마다 검색된 섹션의 데이터 요소 수를 반환합니다. 남은 섹션이 없으면 0을 반환합니다.

예제

다음 예제에서는 GraphicsPath 개체를 만들고 경로에 5개의 그림을 추가합니다. SetMarker 메서드에 대한 호출은 경로에 두 개의 마커를 배치합니다. 첫 번째 표식은 그림의 끝에 있고 두 번째 표식은 그림의 중간에 있습니다. 이 코드는 GraphicsPath 개체의 주소를 GraphicsPathIterator 생성자에 전달하여 경로와 연결된 반복기를 만듭니다. 그런 다음, 코드는 반복기의 GraphicsPathIterator::NextMarker 메서드를 두 번 호출하여 경로의 두 번째 표식으로 구분된 섹션을 가져옵니다. 마지막으로 코드는 경로의 검색된 섹션을 그립니다.


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

   // Create a graphics path with five figures (subpaths).
   GraphicsPath path;

   path.AddRectangle(Rect(20, 20, 60, 30));
   path.SetMarker();                          // first marker

   path.AddLine(100, 20, 160, 50);
   path.AddArc(180, 20, 60, 30, 0.0f, 180.0f);

   path.AddRectangle(Rect(260, 20, 60, 30));

   path.AddLine(340, 20, 400, 50);
   path.SetMarker();                          // second marker
   path.AddArc(340, 20, 60, 30, 0.0f, 180.0f);
   path.CloseFigure();
  
   path.AddRectangle(Rect(420, 20, 60, 30));
 
   // Create an iterator, and associate it with the path.
   GraphicsPathIterator iterator(&path);

   // Get the second marker-delimited section by calling NextMarker twice.
   GraphicsPath section;
   INT count;
   count = iterator.NextMarker(&section);
   count = iterator.NextMarker(&section);

   // The variable "count" now holds the number of 
   // data points in the second marker-delimited section.

   // Draw the retrieved section.
   Pen bluePen(Color(255, 0, 0, 255));
   graphics.DrawPath(&bluePen, &section);
}

요구 사항

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

참고 항목

경로 구성 및 그리기

GetPathData

Graphicspath

GraphicsPathIterator

GraphicsPathIterator::NextSubpath 메서드

NextMarker

경로