This topic has not yet been rated - Rate this topic

Graphics.TranslateClip(INT, INT) method

Applies to: desktop apps only

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

Syntax

Status TranslateClip(
  [in]  INT dx,
  [in]  INT dy
);

Parameters

dx [in]

Type: INT

Integer that specifies the horizontal component of the translation.

dy [in]

Type: INT

Integer that specifies the vertical component of the translation.

Return value

Type:

Type: Status

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.

Examples

The following example creates a Graphics object and sets its clipping region. The code translates the clipping region 100 units to the right and then fills a large rectangle that is clipped by the translated region.


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

   // Set the clipping region.
   graphics.SetClip(Rect(0, 0, 100, 50));

   // Translate the clipping region.
   graphics.TranslateClip(40, 30);

   // 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

Minimum supported client

Windows XP, Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Product

GDI+ 1.0

Header

Gdiplusgraphics.h (include Gdiplus.h)

Library

Gdiplus.lib

DLL

Gdiplus.dll

See also

Graphics
Graphics::GetClip
IntersectClip Methods
Graphics::IsClipEmpty
SetClip Methods
Clipping with a Region
Clipping

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012

Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.