Android Tutorial

(avery) #1
Android Tutorial 267

You can then use the Chess Utrecht typeface to “draw” a
chessboard using the appropriate character sequences.

Using the Chess Utrecht font to draw a chessboard

Measuring Text Screen Requirements

You can measure how large text with a
given Paint is and how big of a rectangle
you need to encompass it using the
measureText() and getTextBounds()
methods.

Working with Bitmaps

You can find lots of goodies for working with graphics such as
bitmaps (including NinePatch) in the android.graphics package. The
core class for bitmaps is android.graphics.Bitmap.

Drawing Bitmap Graphics on a Canvas

You can draw bitmaps onto a valid Canvas, such as within the
onDraw() method of a View, using one of the drawBitmap()
Free download pdf