我看过很多文章吗?但我找不到正确的答案。如何从“onPictureTaken”旋转图片而不会出现内存不足异常?
我尝试做一些这样的:
@Override
public void onPictureTaken(byte[] paramArrayOfByte, Camera paramCamera) {
try {
Bitmap bitmap = BitmapFactory.decodeByteArray(paramArrayOfByte, 0,
paramArrayOfByte.length);
int width = bitmap.getWidth();
int height = bitmap.getHeight();
FileOutputStream os = new ileOutputStream(Singleton.mPushFilePath);
Matrix matrix = new Matrix();
matrix.postRotate(90);
Bitmap resizedBitmap = Bitmap.createBitmap(bitmap, 0, 0, width,
height, matrix, false);
resizedBitmap.compress(Bitmap.CompressFormat.JPEG, 95, os);
os.close();
...
有没有办法可以旋转图片,而无需使用BitmapFactory?我想旋转图片而不损失质量!
这里有一个很好的解决方案:http://stackoverflow.com/questions/2225363/c-sharp-rotate-bitmap-90-degrees – paul 2012-08-09 12:46:19
这是伟大的,但它的C#? – 2012-08-09 12:50:34
对不起 - 没有阅读标签! – paul 2012-08-09 13:00:37