I save bitmap as jpg file. The source code is:
imageView = new ImageView(this);
bitmap = Bitmap.createBitmap(d.getWidth() ,d.getHeight() , Bitmap.Config.ARGB_8888);
canvas = new Canvas (bitmap);
iv.setDrawingCacheEnabled(true);
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, new FileOutputStream(new File("/mnt/sdcard/mrun.jpg")));
I test it on emulator. The file is saved and it has size ~150 Kb. But if I want to open it with any program as MS Paint, I receive the error message. What do I miss? Thanks.
COMMENT: I tried to write instead of the last raw the follow row:
iv.getDrawingCache().compress(Bitmap.CompressFormat.JPEG, 100, new FileOutputStream(new File("/mnt/sdcard/arun.jpg")));
Same result.
I think, that MS Paint can’t work with Alpha channel. So, it can’t read jpg with alpha channel. Just a thought.
try to open by some normal graphic editor. Gimp, for example. It is free.