The Graphics API provides drawing operations. Functions are provided for: drawing and filling various shapes (points, lines, polylines, arcs, rectangles, polygons, ellipses, rounded rectangles and pie slices), for drawing text, and for drawing bitmaps.
Each drawing operation has a number of settings which affect its function pen style, fill style, typeface etc. Instead of
forcing the user to pass these settings as parameters to every drawing function, the Graphics API uses the concept of a graphics
context (GC) in which drawing functions are performed. The CGraphicsContext
class is used to hold these settings, and to provide all of the graphics functionality.
The common way of performing a drawing operation is therefore:
set up a graphics context to hold the settings you desire
call the graphics function of that context to perform the operation required
Graphics contexts are provided by graphics device objects which represents the medium being drawn to. The abstract base class
for graphics device objects is CGraphicsDevice
.