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

来源:互联网 发布:为什么下载淘宝打不开 编辑:程序博客网 时间:2024/05/21 22:51
生成黑白画笔
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) {}
}
原创粉丝点击