Ask Your Question

Revision history [back]

Used to have the same weird problem here. Finally I found out the cause was these lines:

bmp = Bitmap.createScaledBitmap(bmp, canvas.getWidth(), canvas.getHeight(), false);
canvas.drawBitmap(bmp, 0, 0, null);

After I changed them to:

canvas.drawBitmap(bmp, (canvas.getWidth() - bmp.getWidth()) / 2, (canvas.getHeight() - bmp.getHeight()) / 2, null);

Everything went fine and solid. However image may not fullfill the canvas in this way. Still haven't found a proper way to scale the image ...