Export (0) Print
Expand All
Expand Minimize

Graphics.GetClip method

Applies to: desktop apps only

The Graphics::GetClip method gets the clipping region of this Graphics object.

Syntax

Status GetClip(
  [out]  Region *region
) const;

Parameters

region [out]

Type: Region*

Pointer to a Region object that receives the clipping region.

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 sets a clipping region. Next, the code gets the clipping region, stores it in a Region object, and then uses the stored object to fill the region.


VOID Example_GetClip(HDC hdc)
{
   Graphics myGraphics(hdc);
   
   // Set a clipping region.
   myGraphics.SetClip(Rect(0, 0, 200, 100));
   // Get the clipping region.
   
   Region clipRegion;
   myGraphics.GetClip(&clipRegion);
   
   // Fill the clipping region of the myGraphics object.
   myGraphics.FillRegion(&SolidBrush(Color(255, 0, 0, 0)), &clipRegion);
}

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
GetClipBounds Methods
Graphics::ResetClip
SetClip Methods
Region
Clipping with a Region
Clipping

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012

Community Additions

ADD
Show:
© 2014 Microsoft