Share via


Graphics::FillPie (constBrush*,INT,INT,INT,INT,REAL,REAL,REAL) 方法 (gdiplusgraphics.h)

Graphics::FillPie 方法會使用筆刷來填滿餅圖的內部。

語法

Status FillPie(
  [in] const Brush *brush,
  [in] INT         x,
  [in] INT         y,
  [in] INT         width,
  [in] INT         height,
  [in] REAL        startAngle,
  [in] REAL        sweepAngle
);

參數

[in] brush

類型: const Brush*

Brush 物件的指標,用來繪製餅圖的內部。

[in] x

類型: INT

整數,指定矩形左上角的 X 座標,該矩形會系結橢圓形。 橢圓形的弧形部分是餅圖的弧形。

[in] y

類型: INT

整數,指定周框左上角的 Y 座標,該矩形會系結橢圓形。

[in] width

類型: INT

整數,指定系結橢圓形之矩形的寬度。

[in] height

類型: INT

整數,指定限定橢圓形之矩形的高度。

[in] startAngle

類型: REAL

指定角度的實數,以度為單位,介於 X 軸與餅圖弧線的起點之間。

[in] sweepAngle

類型: REAL

指定餅圖弧線起點與終點之間角度的實數。

傳回值

類型: 狀態

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

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

備註

餅圖是橢圓形內部的一部分, (它是由橢圓形曲線所系結,而兩條星形線) 。 startAnglesweepAngle 會指定要使用的省略號部分。

範例

下列範例會定義餅圖,然後填滿它。

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

   // Create a SolidBrush object.
   SolidBrush blackBrush(Color(255, 0, 0, 0));

   // Define the pie shape.
   int x = 0;
   int y = 0;
   int width = 200;
   int height = 100;
   REAL startAngle = 0.0f;
   REAL sweepAngle = 45.0f;

   // Fill the pie.
   graphics.FillPie(&blackBrush, x, y, width, height, startAngle, sweepAngle);
}

規格需求

需求
最低支援的用戶端 Windows XP、Windows 2000 Professional [僅限桌面應用程式]
最低支援的伺服器 Windows 2000 Server [僅限桌面應用程式]
目標平台 Windows
標頭 gdiplusgraphics.h (包含 Gdiplus.h)
程式庫 Gdiplus.lib
Dll Gdiplus.dll

另請參閱

色彩

圖形

狀態