我要旋转我像更多的时间,我不能这样做在的onDraw方法,我的代码是:旋转图像,但图像色彩暗淡和图像变形
options = new BitmapFactory.Options();
options.inScaled = false;
options.inJustDecodeBounds = false;
options.inDither = false;
options.inScaled = false;
options.inPreferredConfig = Bitmap.Config.ARGB_8888;
public void setAddBmpImage(int rotate) {
byte[] by = getBitmapByte(rotatedBitmap);
Bitmap source = BitmapFactory.decodeByteArray(by, 0, by.length, options);
Bitmap bmpSephia = Bitmap.createBitmap(rotatedBitmap.getWidth(), rotatedBitmap.getHeight(), Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bmpSephia);
canvas.rotate(rotate);
canvas.drawBitmap(source, 0, 0, null);
rotatedBitmap= bmpSephia;
imageStartX = (screenWidth/2 - rotatedBitmap.getWidth()/2);
imageStartY = (screenHeight/2 - rotatedBitmap.getHeight()/2);
invalidate();
}
通过图像十分旋转好了,但图像变形,这是非常丑陋的,你能告诉我为什么,并给我一个很好的方法,谢谢使用
后来我会尝试,然后给出结果 – pengwang
我尝试你的方法,这是没有用的 – pengwang