Android Canvas: put Bitmap in the middle of the screen

Code:

[java]

canvas.drawBitmap(bitmap, (getMeasuredWidth()/2)-(bitmap.getWidth()/2), (getMeasuredHeight()/2 -(bitmap.getHeight()/2)), null);

[/java]

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.