你好我是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.我怎么能这样做?谢谢