次の方法で共有


Graphics::TranslateClip(REAL,REAL) メソッド (gdiplusgraphics.h)

Graphics::TranslateClip メソッドは、この Graphics オブジェクトのクリッピング領域を変換します。

構文

Status TranslateClip(
  REAL dx,
  REAL dy
);

パラメーター

dx

平行移動の水平コンポーネントを指定する実数。

dy

平行移動の垂直コンポーネントを指定する実数。

戻り値

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

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

解説

次の例では、文字列のサイズを測定し、そのサイズを表す四角形を描画します。

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

   // Set the clipping region.
   graphics.SetClip(RectF(0.0f, 0.0f, 100.0f, 50.0f));

   // Translate the clipping region.
   graphics.TranslateClip(40.0f, 30.0f);

   // Fill an ellipse that is clipped by the translated clipping region.
   SolidBrush brush(Color(255, 255, 0, 0));
   graphics.FillEllipse(&brush, 20, 40, 100, 80);

   // Draw the outline of the clipping region (rectangle).
   Pen pen(Color(255, 0, 0, 0), 2.0f);
   graphics.DrawRectangle(&pen, 40, 30, 100, 50);
}

要件

要件
Header gdiplusgraphics.h

こちらもご覧ください

クリッピング

領域を使用したクリッピング

グラフィックス

Graphics::GetClip

Graphics::IsClipEmpty

IntersectClip メソッド

SetClip メソッド