0

你好,我是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。我该怎么做?谢谢你

4

1 回答 1

0

使用sprites... 精灵将保存您的位图,然后我们可以translation/rotation在精灵上制作

这里获取一些提示

于 2013-07-29T07:49:10.543 回答