Graphics::TranslateClip(REAL,REAL) method (gdiplusgraphics.h)

The Graphics::TranslateClip method translates the clipping region of this Graphics object.

Syntax

Status TranslateClip(
  REAL dx,
  REAL dy
);

Parameters

dx

Real number that specifies the horizontal component of the translation.

dy

Real number that specifies the vertical component of the translation.

Return value

If the method succeeds, it returns Ok, which is an element of the Status enumeration.

If the method fails, it returns one of the other elements of the Status enumeration.

Remarks

Examples

The following example measures the size of a string and then draws a rectangle that represents that size.

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);
}

Requirements

Requirement Value
Header gdiplusgraphics.h

See also

Clipping

Clipping with a Region

Graphics

Graphics::GetClip

Graphics::IsClipEmpty

IntersectClip Methods

SetClip Methods