Share via


Using Graphics Containers

A Graphics object provides methods such as DrawLine, DrawImage, and DrawString for displaying vector images, raster images, and text. A Graphics object also has several properties that influence the quality and orientation of the items that are drawn. For example, the smoothing mode property determines whether antialiasing is applied to lines and curves, and the world transformation property influences the position and rotation of the items that are drawn.

A Graphics object is associated with a particular display device. When you use a Graphics object to draw in a window, the Graphics object is also associated with that particular window.

A Graphics object can be thought of as a container because it holds a set of properties that influence drawing and it is linked to device-specific information. You can create a secondary container within an existing Graphics object by calling the BeginContainer method of that Graphics object.

In This Section