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

Android绘制图片的几种方式

2014-01-10 09:24 323 查看
1.Bitmap.createBitmap(source, x, y, width, height);

2. Bitmap dstBitmap = Bitmap.createBitmap(width,height, Config.ARGB_8888);

Canvas canvas = new Canvas(dstBitmap);//以dstBimap为模板绘制空

canvas.drawBitmap(srcBitmap, 0, 0, paint);//把新的src添加到模板上。

3.Bitmap bitmap = Bitmap.createBitmap(width,height,Bitmap.Config.ARGB_8888);

Canvas canvas = new Canvas(bitmap);

d.setBounds(0, 0, width, height); 一定要设

d.draw(canvas);//绘制到画布上
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: