11.4. System.Drawing namespace
The main class in this namespace is Graphics. It provides the device context for drawing. We can create device contexts from handles by using the FromHDC(IntPtr ) method, Windows handles by using the FromHWnd(IntPtr ) method, and images by using the FromImage(Image ) method. After we get the device context, we can manipulate regions, perform rendering and transformation, work with metafiles, and draw various geometric figures – arcs, Bezier curves, ellipses, lines, and so on – on the device surface. This is supported by the set of DrawXXX methods shown below:
DrawArc;
DrawBezier;
DrawClosedCurve;
DrawCurve;
DrawEllipse;
DrawIcon;
DrawImage;
DrawImageUnscaled;
DrawLine;
DrawLines;
DrawPath;
DrawPie;
DrawPolygon;
DrawRectangle ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access