你好,我是android编程的新手,我想问一下如何用浮点输入上下翻译位图?这是我的代码:
bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.horizonsx);
bmpWidth = bitmap.getWidth();
bmpHeight = bitmap.getHeight();
drawMatrix();
private void drawMatrix(){
Matrix matrix = new Matrix();
matrix.setTranslate(0,10);
Bitmap resizedBitmap = Bitmap.createBitmap(bitmap, 0,0, bmpWidth, bmpHeight, matrix, true);
imageviewrot.setImageBitmap(resizedBitmap);
imageviewrot.setScaleType(ScaleType.CENTER); ///THIS WAS THE KEY LINE
}
但未能将位图翻译为 10。我该怎么做?谢谢你