Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 35. Programming Vector Graphics > Example: A Drawing Application

35.5. Example: A Drawing Application

Using what you've learned about the drawing API so far, you can create a simple drawing application. This simple application consists of three classes: the ColorPicker, the ToolSet, and the DrawingCanvas. The DrawingCanvas contains both the tool set and the color picker, and it uses events to set the color and tool when these are clicked. It also handles mouse interaction, creating a new curShape when you press the mouse, and updating it as you move the mouse, depending on the tool, color, and other parameters.

Example 35-15 shows the application, all at once.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial