次の方法で共有


Graphics::IntersectClip(constRectF&) メソッド (gdiplusgraphics.h)

Graphics::IntersectClip メソッドは、この Graphics オブジェクトのクリッピング領域を、この Graphics オブジェクトの現在のクリッピング領域と交差する指定された四角形の部分に更新します。

構文

Status IntersectClip(
  const RectF & rect
);

パラメーター

rect

クリッピング領域を更新するために使用される四角形への参照。

戻り値

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

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

解説

次の例では、クリッピング領域を設定し、クリッピング領域を更新します。 次に、有効なクリッピング領域を示すために四角形を描画します。

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

   // Set the clipping region.
   RectF clipRect(0.5f, 0.5f, 200.5f, 200.5f);
   graphics.SetClip(clipRect);

   // Update the clipping region to the portion of the rectangle that
   // intersects with the current clipping region.
   RectF intersectRect(100.5f, 100.5f, 200.5f, 200.5f);
   graphics.IntersectClip(intersectRect);

   // Fill a rectangle to demonstrate the effective clipping region.
   graphics.FillRectangle(&SolidBrush(Color(255, 0, 0, 255)), 0, 0, 500, 500);

   // Reset the clipping region to infinite.
   graphics.ResetClip();

   // Draw clipRect and intersectRect.
   graphics.DrawRectangle(&Pen(Color(255, 0, 0, 0)), clipRect);
   graphics.DrawRectangle(&Pen(Color(255, 255, 0, 0)), intersectRect);
}

要件

要件
Header gdiplusgraphics.h

こちらもご覧ください

クリッピング

領域でのクリッピング

GetClipBounds メソッド

グラフィックス

Graphics::GetClip

RectF

SetClip メソッド

状態