O'Reilly logo

Sams Teach Yourself Android Game Programming in 24 Hours by Jonathan S. Harbour

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

Hour 7. Loading and Drawing Images

What You’ll Learn in This Hour

• How to draw with a custom back buffer

• How to add a bitmap file asset to the project

• How to load a bitmap asset into memory

• How to draw a bitmap image

Double-Buffered Drawing

While getting started learning about bitmap programming with the Android SDK (namely, the Canvas class), it will be helpful to see a practical use for a bitmap and a purposefully created Canvas of our own. Normally, we use the Canvas parameter that is automatically passed to the onDraw() method, so there is no need to create one. But to use a secondary or back buffer for drawing, you will need to learn how to create a Canvas and a Bitmap at runtime. This is a helpful way to get introduced to bitmap ...

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