androidcanvasbitmaptiling

Tiling a Bitmap on a Canvas


I would like to create a 'graph paper' look to the Bitmap I am drawing via a Canvas, and trying to figure out the best way to do this.

I can't pass a source Bitmap containing the graph paper background to the Canvas constructor, as I am getting the Canvas in a SurfaceView via the .lockCanvas() call.

Some solutions I've tried:

Any ideas how to achieve this?


Solution

  • You have two easy solutions: