您的位置:首页 > 移动开发 > Android开发

生成黑白画笔,android使用系统浏览器打开网页,将Bitmap图片存储在本地JPG文件的方法

2013-06-09 14:46 1176 查看
生成黑白画笔

Paint paint = new Paint();
ColorMatrix cm = new ColorMatrix();
cm.setSaturation(0);
ColorMatrixColorFilter f = new ColorMatrixColorFilter(cm);
paint.setColorFilter(f);

android使用系统浏览器打开网页

Uri uri = Uri.parse("http://www.baidu.com");

Intent intent = new Intent(Intent.ACTION_VIEW, uri);

MID.mid.startActivity(intent);

将Bitmap图片存储在本地JPG文件的方法

public static void saveBitmap(Bitmap im , String fileName)

{

try {

File file = new File(fileName);

BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(file));

im.compress(Bitmap.CompressFormat.JPEG, 80, bos);

bos.flush();

bos.close() ;

} catch (Exception e) {}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐