O'Reilly logo

Learning Android Canvas by Mir Nauman Tahir

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

Chapter 3. Drawing and Drawables in Android Canvas

In this chapter our goal is to learn about the following:

  • Drawing on a Canvas
  • Drawing on a View
  • Drawing on a SurfaceView
  • Drawables
  • Drawables from resource images
  • Drawables from resource XML
  • Shape Drawables

Android provides us with 2D drawing APIs that enable us to draw our custom drawing on the Canvas. When working with 2D drawings, we will either draw on view or directly on the surface or Canvas. Using View for our graphics, the drawing is handled by the system's normal View hierarchy drawing process. We only define our graphics to be inserted in the View; the rest is done automatically by the system. While using the method to draw directly on the Canvas, we have to manually call the suitable drawing ...

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