# Graphics Class

The **Graphics** class provides methods for drawing lines, curves, figures, images, and text. A Graphics object stores attributes of the display device and attributes of the items to be drawn.

## Methods

The **Graphics** class has these methods.

Method | Description |
---|---|

Graphics::AddMetafileComment | The Graphics::AddMetafileComment method adds a text comment to an existing metafile. |

Graphics::BeginContainer | The Graphics::BeginContainer method begins a new graphics container. |

Graphics::BeginContainer | The Graphics::BeginContainer method begins a new graphics container. |

Graphics::Clear | The Graphics::Clear method clears a Graphics object to a specified color. |

Graphics::DrawArc | This topic lists the DrawArc methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::DrawArc | This topic lists the DrawArc methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::DrawArc | This topic lists the DrawArc methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::DrawArc | |

Graphics::DrawBezier | This topic lists the DrawBezier methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::DrawBezier | This topic lists the DrawBezier methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::DrawBezier | This topic lists the DrawBezier methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::DrawBezier | |

Graphics::DrawBeziers | This topic lists the DrawBeziers methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::DrawBeziers | This topic lists the DrawBeziers methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::DrawCachedBitmap | The Graphics::DrawCachedBitmap method draws the image stored in a CachedBitmap object. |

Graphics::DrawClosedCurve | This topic lists the DrawClosedCurve methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::DrawClosedCurve | This topic lists the DrawClosedCurve methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::DrawClosedCurve | This topic lists the DrawClosedCurve methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::DrawClosedCurve | |

Graphics::DrawCurve | This topic lists the DrawCurve methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::DrawCurve | This topic lists the DrawCurve methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::DrawCurve | This topic lists the DrawCurve methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::DrawCurve | |

Graphics::DrawCurve | |

Graphics::DrawCurve | |

Graphics::DrawDriverString | The Graphics::DrawDriverString method draws characters at the specified positions. The method gives the client complete control over the appearance of text. The method assumes that the client has already set up the format and layout to be applied. |

Graphics::DrawEllipse | This topic lists the DrawEllipse methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::DrawEllipse | This topic lists the DrawEllipse methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::DrawEllipse | This topic lists the DrawEllipse methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::DrawEllipse | |

Graphics::DrawImage | This topic lists the DrawImage methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::DrawImage | This topic lists the DrawImage methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::DrawImage | This topic lists the DrawImage methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::DrawImage | |

Graphics::DrawImage | |

Graphics::DrawImage | |

Graphics::DrawImage | |

Graphics::DrawImage | |

Graphics::DrawImage | |

Graphics::DrawImage | |

Graphics::DrawImage | |

Graphics::DrawImage | |

Graphics::DrawImage | |

Graphics::DrawImage | |

Graphics::DrawImage | |

Graphics::DrawImage | |

Graphics::DrawImage | |

Graphics::DrawImage | |

Graphics::DrawLine | This topic lists the DrawLine methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::DrawLine | This topic lists the DrawLine methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::DrawLine | This topic lists the DrawLine methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::DrawLine | |

Graphics::DrawLines | This topic lists the DrawLines methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::DrawLines | This topic lists the DrawLines methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::DrawPath | The Graphics::DrawPath method draws a sequence of lines and curves defined by a GraphicsPath object. |

Graphics::DrawPie | This topic lists the DrawPie methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::DrawPie | This topic lists the DrawPie methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::DrawPie | This topic lists the DrawPie methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::DrawPie | |

Graphics::DrawPolygon | This topic lists the DrawPolygon methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::DrawPolygon | This topic lists the DrawPolygon methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::DrawRectangle | This topic lists the DrawRectangle methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::DrawRectangle | This topic lists the DrawRectangle methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::DrawRectangle | This topic lists the DrawRectangle methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::DrawRectangle | |

Graphics::DrawRectangles | This topic lists the DrawRectangles methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::DrawRectangles | This topic lists the DrawRectangles methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::DrawString | This topic lists the DrawString methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::DrawString | This topic lists the DrawString methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::DrawString | This topic lists the DrawString methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::EndContainer | The Graphics::EndContainer method closes a graphics container that was previously opened by the Graphics::BeginContainer method. |

Graphics::EnumerateMetafile | This topic lists the EnumerateMetafile methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::EnumerateMetafile | This topic lists the EnumerateMetafile methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::EnumerateMetafile | This topic lists the EnumerateMetafile methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::EnumerateMetafile | |

Graphics::EnumerateMetafile | |

Graphics::EnumerateMetafile | |

Graphics::EnumerateMetafile | |

Graphics::EnumerateMetafile | |

Graphics::EnumerateMetafile | |

Graphics::EnumerateMetafile | |

Graphics::EnumerateMetafile | |

Graphics::EnumerateMetafile | |

Graphics::ExcludeClip | This topic lists the ExcludeClip methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::ExcludeClip | This topic lists the ExcludeClip methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::ExcludeClip | This topic lists the ExcludeClip methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::FillClosedCurve | This topic lists the FillClosedCurve methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::FillClosedCurve | This topic lists the FillClosedCurve methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::FillClosedCurve | This topic lists the FillClosedCurve methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::FillClosedCurve | |

Graphics::FillEllipse | This topic lists the FillEllipse methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::FillEllipse | This topic lists the FillEllipse methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::FillEllipse | This topic lists the FillEllipse methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::FillEllipse | |

Graphics::FillPath | The Graphics::FillPath method uses a brush to fill the interior of a path. If a figure in the path is not closed, this method treats the nonclosed figure as if it were closed by a straight line that connects the figure's starting and ending points. |

Graphics::FillPie | This topic lists the FillPie methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::FillPie | This topic lists the FillPie methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::FillPie | This topic lists the FillPie methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::FillPie | |

Graphics::FillPolygon | This topic lists the FillPolygon methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::FillPolygon | This topic lists the FillPolygon methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::FillPolygon | This topic lists the FillPolygon methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::FillPolygon | |

Graphics::FillRectangle | This topic lists the FillRectangle methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::FillRectangle | This topic lists the FillRectangle methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::FillRectangle | This topic lists the FillRectangle methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::FillRectangle | |

Graphics::FillRectangles | This topic lists the FillRectangles methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::FillRectangles | This topic lists the FillRectangles methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::FillRegion | The Graphics::FillRegion method uses a brush to fill a specified region. |

Graphics::Flush | The Graphics::Flush method flushes all pending graphics operations. |

Graphics::FromHDC | This topic lists the FromHDC methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::FromHDC | This topic lists the FromHDC methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::FromHWND | The Graphics::FromHWND method creates a Graphics object that is associated with a specified window. |

Graphics::FromImage | The Graphics::FromImage method creates a Graphics object that is associated with a specified Image object. |

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

Graphics::GetClipBounds | This topic lists the GetClipBounds methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::GetClipBounds | This topic lists the GetClipBounds methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::GetCompositingMode | The Graphics::GetCompositingMode method gets the compositing mode currently set for this Graphics object. |

Graphics::GetCompositingQuality | The Graphics::GetCompositingQuality method gets the compositing quality currently set for this Graphics object. |

Graphics::GetDpiX | The Graphics::GetDpiX method gets the horizontal resolution, in dots per inch, of the display device associated with this Graphics object. |

Graphics::GetDpiY | The Graphics::GetDpiY method gets the vertical resolution, in dots per inch, of the display device associated with this Graphics object. |

Graphics::GetHalftonePalette | The Graphics::GetHalftonePalette method gets a Windows halftone palette. |

Graphics::GetHDC | The Graphics::GetHDC method gets a handle to the device context associated with this Graphics object. |

Graphics::GetInterpolationMode | The Graphics::GetInterpolationMode method gets the interpolation mode currently set for this Graphics object. The interpolation mode determines the algorithm that is used when images are scaled or rotated. |

Graphics::GetLastStatus | The Graphics::GetLastStatus method returns a value that indicates the nature of this Graphics object's most recent method failure. |

Graphics::GetNearestColor | The Graphics::GetNearestColor method gets the nearest color to the color that is passed in. This method works on 8-bits per pixel or lower display devices for which there is an 8-bit color palette. |

Graphics::GetPageScale | The Graphics::GetPageScale method gets the scaling factor currently set for the page transformation of this Graphics object. The page transformation converts page coordinates to device coordinates. |

Graphics::GetPageUnit | The Graphics::GetPageUnit method gets the unit of measure currently set for this Graphics object. |

Graphics::GetPixelOffsetMode | The Graphics::GetPixelOffsetMode method gets the pixel offset mode currently set for this Graphics object. |

Graphics::GetRenderingOrigin | The Graphics::GetRenderingOrigin method gets the rendering origin currently set for this Graphics object. |

Graphics::GetSmoothingMode | The Graphics::GetSmoothingMode method determines whether smoothing (antialiasing) is applied to the Graphics object. |

Graphics::GetTextContrast | The Graphics::GetTextContrast method gets the contrast value currently set for this Graphics object. The contrast value is used for antialiasing text. |

Graphics::GetTextRenderingHint | The Graphics::GetTextRenderingHint method returns the text rendering mode currently set for this Graphics object. |

Graphics::GetTransform | The Graphics::GetTransform method gets the world transformation matrix of this Graphics object. |

Graphics::GetVisibleClipBounds | This topic lists the GetVisibleClipBounds methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::GetVisibleClipBounds | This topic lists the GetVisibleClipBounds methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::Graphics | This topic lists the constructors of the Graphics class. For a complete class listing, see Graphics Class. |

Graphics::Graphics | This topic lists the constructors of the Graphics class. For a complete class listing, see Graphics Class. |

Graphics::Graphics | This topic lists the constructors of the Graphics class. For a complete class listing, see Graphics Class. |

Graphics::Graphics | |

Graphics::Graphics | |

Graphics::Graphics | |

Graphics::IntersectClip | This topic lists the InterscetClip methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::IntersectClip | This topic lists the InterscetClip methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::IntersectClip | This topic lists the InterscetClip methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::IsClipEmpty | The Graphics::IsClipEmpty method determines whether the clipping region of this Graphics object is empty. |

Graphics::IsVisible | This topic lists the IsVisible methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::IsVisible | This topic lists the IsVisible methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::IsVisible | This topic lists the IsVisible methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::IsVisible | |

Graphics::IsVisible | |

Graphics::IsVisible | |

Graphics::IsVisible | |

Graphics::IsVisible | |

Graphics::IsVisibleClipEmpty | The Graphics::IsVisibleClipEmpty method determines whether the visible clipping region of this Graphics object is empty. The visible clipping region is the intersection of the clipping region of this Graphics object and the clipping region of the window. |

Graphics::MeasureCharacterRanges | The Graphics::MeasureCharacterRanges method gets a set of regions each of which bounds a range of character positions within a string. |

Graphics::MeasureDriverString | The Graphics::MeasureDriverString method measures the bounding box for the specified characters and their corresponding positions. |

Graphics::MeasureString | This topic lists the MeasureString methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::MeasureString | This topic lists the MeasureString methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::MeasureString | This topic lists the MeasureString methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::MeasureString | |

Graphics::MeasureString | |

Graphics::MultiplyTransform | The Graphics::MultiplyTransform method updates this Graphics object's world transformation matrix with the product of itself and another matrix. |

Graphics::ReleaseHDC | The Graphics::ReleaseHDC method releases a device context handle obtained by a previous call to the Graphics::GetHDC method of this Graphics object. |

Graphics::ResetClip | The Graphics::ResetClip method sets the clipping region of this Graphics object to an infinite region. |

Graphics::ResetTransform | The Graphics::ResetTransform method sets the world transformation matrix of this Graphics object to the identity matrix. |

Graphics::Restore | The Graphics::Restore method sets the state of this Graphics object to the state stored by a previous call to the Graphics::Save method of this Graphics object. |

Graphics::RotateTransform | The Graphics::RotateTransform method updates the world transformation matrix of this Graphics object with the product of itself and a rotation matrix. |

Graphics::Save | The Graphics::Save method saves the current state (transformations, clipping region, and quality settings) of this Graphics object. You can restore the state later by calling the Graphics::Restore method. |

Graphics::ScaleTransform | The Graphics::ScaleTransform method updates this Graphics object's world transformation matrix with the product of itself and a scaling matrix. |

Graphics::SetAbort | Not used in Windows GDI+ versions 1.0 and 1.1. |

Graphics::SetClip | This topic lists the SetClip methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::SetClip | This topic lists the SetClip methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::SetClip | This topic lists the SetClip methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::SetClip | |

Graphics::SetClip | |

Graphics::SetClip | |

Graphics::SetCompositingMode | The Graphics::SetCompositingMode method sets the compositing mode of this Graphics object. |

Graphics::SetCompositingQuality | The Graphics::SetCompositingQuality method sets the compositing quality of this Graphics object. |

Graphics::SetInterpolationMode | The Graphics::SetInterpolationMode method sets the interpolation mode of this Graphics object. The interpolation mode determines the algorithm that is used when images are scaled or rotated. |

Graphics::SetPageScale | The Graphics::SetPageScale method sets the scaling factor for the page transformation of this Graphics object. The page transformation converts page coordinates to device coordinates. |

Graphics::SetPageUnit | The Graphics::SetPageUnit method sets the unit of measure for this Graphics object. The page unit belongs to the page transformation, which converts page coordinates to device coordinates. |

Graphics::SetPixelOffsetMode | The Graphics::SetPixelOffsetMode method sets the pixel offset mode of this Graphics object. |

Graphics::SetRenderingOrigin | The Graphics::SetRenderingOrigin method sets the rendering origin of this Graphics object. The rendering origin is used to set the dither origin for 8-bits-per-pixel and 16-bits-per-pixel dithering and is also used to set the origin for hatch brushes. |

Graphics::SetSmoothingMode | The Graphics::SetSmoothingMode method sets the rendering quality of the Graphics object. |

Graphics::SetTextContrast | The Graphics::SetTextContrast method sets the contrast value of this Graphics object. The contrast value is used for antialiasing text. |

Graphics::SetTextRenderingHint | The Graphics::SetTextRenderingHint method sets the text rendering mode of this Graphics object. |

Graphics::SetTransform | The Graphics::SetTransform method sets the world transformation of this Graphics object. |

Graphics::TransformPoints | The Graphics::TransformPoints method converts an array of points from one coordinate space to another. The conversion is based on the current world and page transformations of this Graphics object. |

Graphics::TransformPoints | The Graphics::TransformPoints method converts an array of points from one coordinate space to another. The conversion is based on the current world and page transformations of this Graphics object. |

Graphics::TranslateClip | This topic lists the TranslateClip methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::TranslateClip | This topic lists the TranslateClip methods of the Graphics class. For a complete list of methods for the Graphics class, see Graphics. |

Graphics::TranslateTransform | The Graphics::TranslateTransform method updates this Graphics object's world transformation matrix with the product of itself and a translation matrix. |

## Requirements

Target Platform |
Windows |

Header |
gdiplusgraphics.h |