ビットマップを作成したところ、そのビットマップをどこかのディレクトリに保存します。誰でも私にこれがどのように行われたかを教えてもらえますかおかげAndroidでsdカードのディレクトリにビットマップを作成しました
FileInputStream in;
BufferedInputStream buf;
try {
in = new FileInputStream("/mnt/sdcard/dcim/Camera/2010-11-16_18-57-18_989.jpg");
buf = new BufferedInputStream(in);
Bitmap _bitmapPreScale = BitmapFactory.decodeStream(buf);
int oldWidth = _bitmapPreScale.getWidth();
int oldHeight = _bitmapPreScale.getHeight();
int newWidth = 2592;
int newHeight = 1936;
float scaleWidth = ((float) newWidth)/oldWidth;
float scaleHeight = ((float) newHeight)/oldHeight;
Matrix matrix = new Matrix();
// resize the bit map
matrix.postScale(scaleWidth, scaleHeight);
Bitmap _bitmapScaled = Bitmap.createBitmap(_bitmapPreScale, 0, 0, oldWidth, oldHeight, matrix, true);
(私は私のSDカード上のフォルダに_bitmapScaled保存したい)
'newWidth = 2592'それはメモリ不足の例外スローしませんでしたか? –
@MuhammadBabarディスクに保存してイメージビューで使用しないとしないと、 –