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 ...
Get Sams Teach Yourself Android Game Programming in 24 Hours 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.