Chand Colorfigs
Chand Colorfigs
Programming
with GDI+
Mahesh Chand
Figure 2.4: Drawing a line from point (0, 0) to point (120, 80) 13
Figure 2.5: Creating a Windows application 13
Figure 2.6: Adding a reference to System.Drawing.dll 14
Figure 2.7: The System.Drawing namespace in a project 14
Figure 2.8: Adding the Form_Paint event handler 15
Figure 2.9: Your first GDI+ application 15
Figure 2.10: Using Point to draw a line 16
Figure 2.11: Using PointF to draw a line 16
Figure 2.12: Using Rectangle to create rectangles 17
Figure 2.13: Using RectangleF to create rectangles 17
Figure 2.14: Using the Round, Truncate, Union, Inflate, Ceiling, and
Intersect methods of Rectangle 18
3
4 GRAPHICS PROGRAMMING WITH GDI+
Figure 2.4: Drawing a line from point (0, 0) to point (120, 80)
Figure 2.14: Using the Round, Truncate, Union, Inflate, Ceiling, and Intersect
methods of Rectangle
Gradient Range
Figure 5.11: Getting line spacing, ascent, descent, free (extra) space, and height of a font
COLOR FIGURES 37
Figure 7.16: The image of Figure 7.10, flipped in both the x-and the y-directions
Figure 7.27: The image of Figure 7.24 with 200 percent zoom
Figure 7.28: The image of Figure 7.24 with 500 percent zoom
Figure 7.43: New image, with width of 200 and height of 200
COLOR FIGURES 67
Figure 9.7: A rectangle, an ellipse, and a curve with different line styles
Starting Cap
Ending Cap
Graphics Container A
SmoothingMode =
SmoothingMode.AntiAlias;
Graphics
Container C Graphics Container B
InterpolationMode = SmoothingMode =
InterpolationMode.High SmoothingMode.HighQuality
Application Device
World Page
Transformation Transformation
A(x1,y1) A(p1,q1) A(c1,d1)
B(x2,y2) B(p2,q2) B(c2,d2)
Figure 10.3: Drawing a line from point (0, 0) to point (120, 80)
COLOR FIGURES 93
Figure 10.4: Drawing a line from point (0, 0) to point (120, 80) with origin (50, 40)
94 GRAPHICS PROGRAMMING WITH GDI+
Figure 13.5: The same result from two different drawing methods
132 GRAPHICS PROGRAMMING WITH GDI+