Export (0) Print
Expand All

System.Drawing Namespace

The System.Drawing namespace provides access to GDI+ basic graphics functionality. More advanced functionality is provided in the System.Drawing.Drawing2D, System.Drawing.Imaging, and System.Drawing.Text namespaces.

The Graphics class provides methods for drawing to the display device. Classes such as Rectangle and Point encapsulate GDI+ primitives. The Pen class is used to draw lines and curves, while classes derrived from the abstract class Brush are used to fill the interiors of shapes.

Namespace hierarchy

Classes

Class Description
Bitmap Encapsulates a GDI+ bitmap, which consists of the pixel data for a graphics image and its attributes. A Bitmap object is an object used to work with images defined by pixel data.
Brush Classes derived from this abstract base class define objects used to fill the interiors of graphical shapes such as rectangles, ellipses, pies, polygons, and paths.
Brushes Brushes for all the standard colors. This class cannot be inherited.
ColorConverter Converts colors from one data type to another. Access this class through the TypeDescriptor.
ColorTranslator Translates colors to and from GDI+ Color structures. This class cannot be inherited.
Font Defines a particular format for text, including font face, size, and style attributes. This class cannot be inherited.
FontConverter Converts Font objects from one data type to another. Access the FontConverter class through the TypeDescriptor object.
FontFamily Defines a group of type faces having a similar basic design and certain variations in styles. This class cannot be inherited.
Graphics Encapsulates a GDI+ drawing surface. This class cannot be inherited.
Icon Represents a Windows icon, which is a small bitmap image used to represent an object. Icons can be thought of as transparent bitmaps, although their size is determined by the system.
IconConverter Converts an Icon object from one data type to another. Access this class through the TypeDescriptor object.
Image An abstract base class that provides functionality for the Bitmap and Metafile descended classes.
ImageAnimator Animates an image that has time-based frames.
ImageConverter ImageConverter is a class that can be used to convert Image objects from one data type to another. Access this class through the TypeDescriptor object.
ImageFormatConverter ImageFormatConverter is a class that can be used to convert colors from one data type to another. Access this class through the TypeDescriptor object.
Pen Defines an object used to draw lines and curves. This class cannot be inherited.
Pens Pens for all the standard colors. This class cannot be inherited.
PointConverter Converts a Point object from one data type to another. Access this class through the TypeDescriptor object.
RectangleConverter Converts rectangles from one data type to another. Access this class through the TypeDescriptor.
Region Describes the interior of a graphics shape composed of rectangles and paths. This class cannot be inherited.
SizeConverter The SizeConverter class is used to convert from one data type to another. Access this class through the TypeDescriptor object.
SolidBrush Defines a brush of a single color. Brushes are used to fill graphics shapes, such as rectangles, ellipses, pies, polygons, and paths. This class cannot be inherited.
StringFormat Encapsulates text layout information (such as alignment and line spacing), display manipulations (such as ellipsis insertion and national digit substitution) and OpenType features. This class cannot be inherited.
SystemBrushes Each property of the SystemBrushes class is a SolidBrush object that is the color of a Windows display element.
SystemColors Each property of the SystemColors class is a Color structure that is the color of a Windows display element.
SystemIcons Each property of the SystemIcons class is an Icon object for Windows system-wide icons. This class cannot be inherited.
SystemPens Each property of the SystemPens class is a Pen object that is the color of a Windows display element and that is a width of 1.
TextureBrush Each property of the TextureBrush class is a Brush object that uses an image to fill the interior of a shape. This class cannot be inherited.
ToolboxBitmapAttribute You can apply a ToolboxBitmapAttribute to a control so that containers, such as Microsoft Visual Studio Form Designer, can retrieve an icon that represents the control. The bitmap for the icon can be in a file by itself or embedded in the assembly that contains the control.

The size of the bitmap that you embed in the control's assembly (or store in a separate file) should be 16 by 16. The GetImage method of a ToolboxBitmapAttribute object can return the small 16 by 16 image or a large 32 by 32 image that it creates by scaling the small image.

Structures

Structure Description
CharacterRange Specifies a range of character positions within a string.
Color Represents an ARGB color.
Point Represents an ordered pair of integer x- and y-coordinates that defines a point in a two-dimensional plane.
PointF Represents an ordered pair of floating point x- and y-coordinates that defines a point in a two-dimensional plane.
Rectangle Stores a set of four integers that represent the location and size of a rectangle. For more advanced region functions, use a Region object.
RectangleF Stores a set of four floating-point numbers that represent the location and size of a rectangle. For more advanced region functions, use a Region object.
Size Stores an ordered pair of integers, typically the width and height of a rectangle.
SizeF Stores an ordered pair of floating-point numbers, typically the width and height of a rectangle.

Delegates

Delegate Description
Graphics.DrawImageAbort Provides a callback method for deciding when the DrawImage method should prematurely cancel execution and stop drawing an image.
Graphics.EnumerateMetafileProc Provides a callback method for the EnumerateMetafile method.
Image.GetThumbnailImageAbort Provides a callback method for determining when the GetThumbnailImage method should prematurely cancel execution.

Enumerations

Enumeration Description
ContentAlignment Specifies alignment of content on the drawing surface.
FontStyle Specifies style information applied to text.
GraphicsUnit Specifies the unit of measure for the given data.
KnownColor Specifies the known system colors.
RotateFlipType Specifies the direction of an image's rotation and the axis used to flip the image.
StringAlignment Specifies the alignment of a text string relative to its layout rectangle.
StringDigitSubstitute The StringDigitSubstitute enumeration specifies how to substitute digits in a string according to a user's locale or language.
StringFormatFlags Specifies the display and layout information for text strings.
StringTrimming Specifies how to trim characters from a string that does not completely fit into a layout shape.
StringUnit Specifies the units of measure for a text string.

See Also

.NET Framework Class Library

Show:
© 2014 Microsoft