Graphics::FillRectangle(constBrush*,constRectF&) 方法 (gdiplusgraphics.h)
Graphics::FillRectangle 方法會使用筆刷來填滿矩形的內部。
語法
Status FillRectangle(
const Brush *brush,
const RectF & rect
);
參數
brush
用來繪製矩形內部 Brush 的指標。
rect
要填滿之矩形的參考。
傳回值
如果方法成功,它會傳回 Ok,這是 Status 列舉的元素。
如果方法失敗,它會傳回 Status 列舉的其他元素之一。
言論
例子
VOID Example_FillRectangle2(HDC hdc)
{
Graphics graphics(hdc);
// Create a SolidBrush object.
SolidBrush blackBrush(Color(255, 0, 0, 0));
// Create a RectF object.
RectF fillRect(1.0f, 2.5f, 100.3f, 100.9f);
// Fill the rectangle.
graphics.FillRectangle(&blackBrush, fillRect);
}
要求
要求 | 價值 |
---|---|
標頭 | gdiplusgraphics.h |