Saving as png image in android

I am developing a drawing application and I save the drawing as png. For drawing, I used a canvas that was created with a bitmap. It works, but the image is distorted. Can someone help me. I did not test it with a real phone, but on an emulator. This is a problem with the emulator. I think he has very little processing ability. I'm right? Thanks.

+6
android android-emulator save bitmap canvas
source share
1 answer

The emulator works great. What part of the code did you use to store the bitmap as png?

The following works fine in the emulator:

Bitmap bitmap = createYourBitmap(); OutputStream stream = new FileOutputStream("/sdcard/test.png"); /* Write bitmap to file using JPEG or PNG and 80% quality hint for JPEG. */ bitmap.compress(CompressFormat.PNG, 80, stream); stream.close(); 
+15
source share

All Articles