我在画布上有一个位图,我需要将它对齐到画布的中心(图片的中心应该在画布的中心)。在纵向视图下,如何适当地缩放画布和图像以适应分辨率?
public void onDraw(Canvas canvas) {
Bitmap imgtable = BitmapFactory.decodeResource(getResources(), R.drawable.table_01);
canvas.drawColor(Color.TRANSPARENT);
canvas.drawBitmap(imgtable, 10, 10, null);
}