是否有关于如何创建JPEG图像或转换成JPEG Android上的任何教程? [英] Are there any tutorials on how to create jpeg images or convert images into jpeg on Android?

查看:103
本文介绍了是否有关于如何创建JPEG图像或转换成JPEG Android上的任何教程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

1.myJpegFile =新的文件(图像/ jpegImage.jpg);结果
 2.输出=新的BufferedOutputStream(新的FileOutputStream(myJpegFile));结果
 3.en codeR = JPEG codec.createJPEGEn codeR(输出);结果
 4.en coder.en code(myJpegImage);

1.myJpegFile = new File("images/jpegImage.jpg");
2.output = new BufferedOutputStream(new FileOutputStream(myJpegFile));
3.encoder = JPEGCodec.createJPEGEncoder(output);
4.encoder.encode(myJpegImage);

请你给我相当于code线路没有。 3和4的Andr​​oid?

Please could you give me the equivalent code for line no. 3 and 4 in Android?

推荐答案

bitmap.com preSS(比较pressFormat.JPEG,100,输出);

bitmap.compress(CompressFormat.JPEG, 100, output);

这篇关于是否有关于如何创建JPEG图像或转换成JPEG Android上的任何教程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆