保存在android的PNG图像 [英] Saving as a png image in android
本文介绍了保存在android的PNG图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我开发的涂料应用程序,我救我的绘画为png图片。对于绘画,我用了一个位图创建画布。它的工作原理,但形象被破坏。任何一个可以帮助我。我没有一个真正的手机,但在模拟器上进行检查。那是问题模拟器。我认为这是非常小的处理能力。我对吗? 谢谢你。
I am developing paint app and i save my drawing as png image. For drawing i used canvas that created with a bitmap. it works but image was corrupted. Can any one help me. I didn't check it with a real phone but on the emulator. Is that problem with emulator. I think it has very small processing ability. Am i right? Thank you.
推荐答案
仿真器工作正常。你用什么一块code存储位图PNG?
The emulator works fine. What piece of code did you use to store the bitmap as png?
细下工作在模拟器中:
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();
这篇关于保存在android的PNG图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文