I am trying to save image in sd card like as :
Bitmap bitmap=Bitmap.createBitmap(400, 300, Bitmap.Config.ARGB_8888);
Canvas canvas=new Canvas(bitmap);
imageView.draw(canvas);
file = new File(folder, "temp.jpg");
try {
outStream = new FileOutputStream(file);
bitmapP.compress(Bitmap.CompressFormat.JPEG, 100, outStream);
outStream.flush();
outStream.close();
return file.toString();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return null;
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return null;
}
Now i get image like as:
Bitmap bitmap = BitmapFactory.decodeFile(image);
I got bitmap, But my bitmap quality is going blur…
What’s i doing wrong ?
Any one can help me?
thanks
JPEGis not a lossless format. It is normal that it gets blurred little bit. Other options are Bitmap.CompressFormat.WEBP & Bitmap.CompressFormat.PNG