The Canvas object has some very handy methods – specifically drawBitmap, which allows multiple bitmaps to be written to a single pallet. However, normally the Canvas object is manipulated by overriding the onDraw method of a View – which is called every time the View is to be rendered (this includes scrolling, which fires many times per second). So if opening an image file based on scroll position (as is the case with tiled maps or backgrounds), this can dramatically impact performance.

While the boards (stack, mostly) had lots of “hints”, it took me the better part of an afternoon figuring out how to manipulate a Canvas instance outside of an overridden onDraw.

1. Create a *new*, empty bitmap to work with

2. Wrap it in a Canvas instance

3. Draw or otherwise manipulate your canvas until you’re ready to show it off.

4. That original empty bitmap has been manipulated during each call to a Canvas method, and is modified and ready for use, e.g., in an ImageView

Also remember to set LayoutParams to the view as normal – failing to do so will result in a 0x0 (invisible) render.