03.01.2015 Views

C# 5.0 Programmer's Reference

Visual Studio 2013 C# 5.0 Programmer's Reference

Visual Studio 2013 C# 5.0 Programmer's Reference

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Windows Forms Printing ❘ 787<br />

➤➤<br />

➤➤<br />

➤➤<br />

System.Drawing.Imaging—This namespace contains classes that deal with more<br />

advanced bitmap graphics including ColorMap, ColorPalette, ImageFormat, Metafile,<br />

MetafileHeader, MetaHeader, and WmfPlaceableFileHeader.<br />

System.Drawing.Printing—This namespace contains objects used for printing and<br />

managing the printer’s characteristics including Margins, PageSettings, PaperSize,<br />

PaperSource, PrinterResolution, and PrinterSettings.<br />

System.Drawing.Text—This namespace contains classes for working with installed fonts<br />

including FontCollection, InstalledFontCollection, and PrivateFontCollection.<br />

Drawing Graphics<br />

The basic steps for drawing in <strong>C#</strong> are to obtain a Graphics object and use its methods to draw shapes.<br />

Brush classes determine how shapes are filled, and Pen classes determine how lines are drawn.<br />

The following sections describe the most useful properties and methods provided by key<br />

drawing classes.<br />

Graphics<br />

The Graphics object represents a drawing surface. The following table lists the Graphics object’s<br />

drawing methods.<br />

Drawing Method<br />

DrawArc<br />

DrawBezier<br />

DrawBeziers<br />

DrawClosedCurve<br />

DrawCurve<br />

DrawEllipse<br />

DrawIcon<br />

DrawIconUnstretched<br />

DrawImage<br />

DrawImageUnscaled<br />

DrawLine<br />

Purpose<br />

Draws an arc of an ellipse<br />

Draws a Bézier curve<br />

Draws a series of connected Bézier curves<br />

Draws a smooth closed curve that connects a series of points,<br />

joining the final point to the first point<br />

Draws a smooth curve that connects a series of points<br />

Draws an ellipse<br />

Draws an Icon onto the Graphics object’s drawing surface<br />

Draws an Icon object onto the Graphics object’s drawing surface<br />

without scaling<br />

Draws an Image object onto the Graphics object’s drawing<br />

surface<br />

Draws an Image object onto the drawing surface without scaling<br />

Draws a line<br />

continues<br />

www.it-ebooks.info

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!