Previous Section  < Day Day Up >  Next Section

Chapter 8

A1:

The Graphics object encapsulates the drawing surface and is used to draw; the ClipRectangle represents the area that needs to be redrawn.

A2:


Control.Invalidate().


A3:

C

A4:

b fails because Brush is an abstract class.

A5:

b is more transparent because its alpha value (200) is less than the value (255) of color a.

A6:

100%. The image is scaled to fit the rectangle.

A7:

Here is one solution:


Graphics g = panel1.CreateGraphics();

g.SmoothingMode = SmoothingMode.AntiAlias;

GraphicsPath gp = new GraphicsPath();

gp.AddLine(10, 170, 30, 170);

gp.AddLine(16, 100, 100, 100);

gp.AddLine(100, 100, 190, 180);

gp.AddLine(40, 50, 50, 20);

gp.StartFigure();

gp.AddLine(50, 20, 145, 100);

gp.StartFigure();

gp.AddArc(65, 10, 120, 180, 180, 80);

gp.StartFigure();

gp.AddArc(65, 5, 120, 100, 200, 70);

g.DrawPath(new Pen(Color.Black, 2), gp);


A8:

D

    Previous Section  < Day Day Up >  Next Section