@Override
protected void onDraw(Canvas canvas) {
float w, h, cx, cy;
w = getWidth();
h = getHeight();
cx = w/2;
cy = h/2;
canvas.drawRect(0, 0, w, h, BackPaint);
Bitmap myBitmap = BitmapFactory.decodeResource(
getResources(),
R.drawable.ic_launcher);
canvas.drawBitmap(myBitmap, cx, cy, null);
};
Download the files.
No comments:
Post a Comment