我想旋轉並保存旋轉的圖像,並將其移動到我的Android設備中的其他地方。位圖旋轉和保存圖像
- 我可以旋轉我的圖像並將其設置爲圖像視圖。
- 我可以將UN-ROTATED圖像複製到我選擇的目的地。
我不能做的就是保存旋轉圖像文件的唯一的事(rotated.jpg)
下面我的代碼旋轉:(不保存旋轉文件存儲?)
Bitmap bmp = BitmapFactory.decodeFile(filePathLocal);
Matrix matrix = new Matrix();
matrix.postRotate(getImageOrientation(filePathLocal));
rotatedBitmap = Bitmap.createBitmap(bmp, 0, 0, bmp.getWidth(), bmp.getHeight(), matrix, true);
//Set Image
ImageButton ibProfile = (ImageButton) findViewById(R.id.ibProfile);
ibProfile.setImageBitmap(rotatedBitmap);
現在上面只是暫時旋轉,直到活動結束,現在我想從上面的代碼保存這個旋轉的圖像,並將它上傳到服務器之前,它已經知道如何複製/移動文件並上傳不需要發佈這些代碼 - 我需要的只是用於保存旋轉圖像的代碼,所以我有一些代碼荷蘭國際集團一樣/sdcard/saved_rotated_image.jpg
你知道如何在文件中保存位圖嗎? –