Graphics::D rawRectangles(constPen*,constRectF*,INT) メソッド (gdiplusgraphics.h)

Graphics::D rawRectangles メソッドは、四角形のシーケンスを描画します。

構文

Status DrawRectangles(
  const Pen   *pen,
  const RectF *rects,
  INT         count
);

パラメーター

pen

四角形の描画に使用される ペン へのポインター。

rects

描画する四角形の座標を指定する RectF オブジェクトの配列へのポインター。

count

rects 配列内の要素の数を指定する整数。

戻り値

メソッドが成功した場合は、Status 列挙の要素である Ok を返します

メソッドが失敗した場合は、 Status 列挙体の他の要素のいずれかを返します。

解説

次の例では、四角形のグループを描画します。

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

   // Create a Pen object.
   Pen blackPen(Color(255, 0, 0, 0), 3);
   
   // Create an array of RectF objects.
   RectF rect1(0.0f, 0.0f, 100.0f, 200.0f);
   RectF rect2(100.0f, 200.0f, 250.0f, 50.0f);
   RectF rect3(300.0f, 0.0f, 50.0f, 100.0f);
   RectF rects[] = {rect1, rect2, rect3};
   RectF* pRects = rects;

   // Draw the rectangles.
   graphics.DrawRectangles(&blackPen, pRects, 3);
}

必要条件

   
Header gdiplusgraphics.h

関連項目

DrawRectangles メソッド

FillRectangle メソッド

グラフィックス

ペン、直線、および四角形

Rect

ペンを使用した直線と四角形の描画