Chapter 15. Programming Custom Graphics

So far, you have built user interfaces entirely from existing controls or controls that you created based on other controls. When you are writing programs with Visual Basic 2008, you also have the freedom to draw your own user interface. This gives you absolute freedom over the look and feel of your programs, and makes certain programming tasks possible.

In this chapter, you look at the graphics and drawing functionality available in Visual Basic 2008. You will be introduced to the concepts by building a fairly complex drawing program, just to illustrate how simple drawing your own user interface actually is. Toward the end of the chapter, you will examine some of the multimedia features of Visual Basic 2008 and learn how you can display common Internet file formats such as .gif, .jpg, and .png.

In this chapter, you will:

  • Learn about the System.Drawing namespace

  • Use pens and brushes

  • Learn how to select and use colors

  • Size and stretch images

  • Create your own Paint program

Building a Simple Paint Program

In this section, you create a simple Paint program by creating a new Windows application project and building some user controls that you will wire up to provide functionality for the application.

Creating a Project with User Controls

Your motivation for building user controls for this application is simple: its good practice to break the application down into components. By following this technique, if you want to pull your paint functionality out of this ...

Get Beginning Microsoft® Visual Basic® 2008 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.