Share via


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

Graphics::D rawCurve 메서드는 카디널 스플라인을 그립니다.

구문

Status DrawCurve(
  [in] const Pen   *pen,
  [in] const Point *points,
  [in] INT         count,
  [in] INT         offset,
  [in] INT         numberOfSegments,
  [in] REAL        tension
);

매개 변수

[in] pen

형식: const *

카디널 스플라인을 그리는 데 사용되는 펜에 대한 포인터입니다.

[in] points

형식: const Point*

카디널 스플라인에서 통과하는 좌표를 지정하는 Point 개체의 배열에 대한 포인터입니다.

[in] count

형식: INT

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

[in] offset

형식: INT

카디널 스플라인이 시작되는 지점을 지정하는 요소 배열의 요소를 지정하는 정수입니다.

[in] numberOfSegments

형식: INT

카디널 스플라인의 세그먼트 수를 지정하는 정수입니다.

[in] tension

형식: REAL

곡선이 카디널 스플라인의 좌표를 통해 얼마나 긴밀하게 구부러지는지를 지정하는 실수입니다.

반환 값

형식: 상태

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

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

설명

세그먼트는 카디널 스플라인에서 연속된 두 점을 연결하는 곡선으로 정의됩니다. 각 세그먼트의 끝점은 다음 세그먼트의 시작점입니다. numberOfSegments 매개 변수는 count 매개 변수에서 오프셋 매개 변수와 1을 뺀 값보다 크지 않아야 합니다.

예제

다음 예제에서는 카디널 스플라인을 그립니다.

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

   // Define a Pen object and an array of Point objects.
   Pen greenPen(Color::Green, 3);
   Point point1(100, 100);
   Point point2(200, 50);
   Point point3(400, 10);
   Point point4(500, 100);

   Point curvePoints[4] = {
   point1,
   point2,
   point3,
   point4};

   Point* pcurvePoints = curvePoints;

   // Specify offset, number of segments to draw, and tension.
   int offset = 1;
   int segments = 2;
   REAL tension = 1.0;

   // Draw the curve.
   graphics.DrawCurve(&greenPen, curvePoints, 4, offset, segments, tension);

   //Draw the points in the curve.
   SolidBrush redBrush(Color::Red);
   graphics.FillEllipse(&redBrush, Rect(95, 95, 10, 10));
   graphics.FillEllipse(&redBrush, Rect(195, 45, 10, 10));
   graphics.FillEllipse(&redBrush, Rect(395, 5, 10, 10));
   graphics.FillEllipse(&redBrush, Rect(495, 95, 10, 10));
}

요구 사항

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

추가 정보

카디널 스플라인

DrawClosedCurve 메서드

카디널 스플라인 그리기

그래픽

Point