Listing 1218 Close JobjavaclosejobView class

Required classes for drawing public class closejobView extends View { Bitmap _bitmap; Canvas _canvas; final Paint _paint; int lastX; int lastY;

public closejobView(Context c) { super(c);

_paint = new Paint(); _paint.setColor(Color.BLACK); lastX = -1;

closejobView extends the base class View

Initialize drawing classes

Save method persists signature

public boolean Save (OutputStream os) { <1— try {

_canvas.drawText("Unlocking Android", 10, 10, _paint); _canvas.drawText("http://manning.com/ableson", 10, 25, _paint); _canvas.drawText("http://android12.msi-wireless.com", 10, 40,

_bitmap.compress(Bitmap.CompressFormat.JPEG, 100, os) ; <-

invalidate(); return true; } catch ( Exception e) { return false;

0 0

Post a comment