Graphics::TranslateClip (REAL,REAL) 方法 (gdiplusgraphics.h)

Graphics::TranslateClip 方法转换此 Graphics 对象的剪辑区域。

语法

Status TranslateClip(
  REAL dx,
  REAL dy
);

参数

dx

指定平移的水平分量的实数。

dy

指定转换的垂直部分的实数。

返回值

如果该方法成功,则返回 Ok,这是 Status 枚举的元素。

如果方法失败,它将返回 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 方法