O'Reilly logo

Application Development Using Visual Basic® and .NET by Dana L. Wyatt, Peter Thorsteinson, Robert J. Oberg

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

A Drawing Program

Vector graphics deals with drawing geometric shapes such as lines, curves, and polygons. In this section we illustrate vector graphics in GDI+ with an interactive drawing program. Later in the chapter we will introduce raster graphics and bitmaps.

Our sample program, DrawDemo, allows you to draw a picture consisting of rectangles and ellipses of various sizes, colors, and patterns. The program illustrates both standard painting (implemented by an override of OnPaint) and “rubber-band” drawing, in which a shape is temporarily outlined as the mouse is moved. We also illustrate use of a clipping rectangle, which can make for more efficient drawing.

Rubber-Band Drawing

Version 1 of DrawDemo illustrates drawing a single rectangle. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required