Share via


Graphics::D rawPie (constPen*,constRectF&,REAL,REAL) 方法 (gdiplusgraphics.h)

Graphics::D rawPie 方法會繪製餅圖。

語法

Status DrawPie(
  const Pen     *pen,
  const RectF & rect,
  REAL          startAngle,
  REAL          sweepAngle
);

參數

pen

用來繪製餅圖的畫筆指標。

rect

將橢圓形系結在其中繪製餅圖的矩形。

startAngle

指定 X 軸與定義餅圖之弧線起點之間角度的實數。 正值指定順時針旋轉。

sweepAngle

指定角度的實數,以度為單位,介於定義餅圖之弧線的起點和終點之間。 正值指定順時針旋轉。

傳回值

如果方法成功,它會傳回 Ok,這是 Status 列舉的元素。

如果方法失敗,它會傳回 Status 列舉的其他其中一個專案。

備註

範例

下列範例會繪製餅圖。

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

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

   // Define the pie.
   RectF ellipseRect(0, 0, 200, 100);
   REAL startAngle = 0.0f;
   REAL sweepAngle = 45.0f;

   // Draw the pie.
   graphics.DrawPie(&blackPen, ellipseRect, startAngle, sweepAngle);
}

規格需求

需求
標頭 gdiplusgraphics.h

另請參閱

FillPie 方法

開啟與關閉的曲線

RectF