August 2003
Intermediate to advanced
736 pages
14h 48m
English
No matter what kind of drawing you're doing, the underlying abstraction that you're dealing with is the Graphics class from the System.Drawing namespace. The Graphics class provides the abstract surface on which you're drawing, whether the results of your drawing operations are displayed on the screen, stored in a file, or spooled to the printer. The Graphics class is too large to show here, but we'll come back to it again and again throughout the chapter.
One way to obtain a graphics object is to use CreateGraphics to create a new one associated with a form:
bool drawEllipse = false;
void drawEllipseButton_Click(object sender, EventArgs e) {
// Toggle whether or not to draw the ellipse
drawEllipse = !drawEllipse;
Graphics ...Read now
Unlock full access