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

android bitmap 获取像素

2015-07-23 15:08 387 查看
android bitmap 获取像素并可以重新创建bitmap

Bitmap b = Bitmap.createBitmap(100, 100, Config.ARGB_4444);

b.setPixel(99, 99, Color.WHITE);

int[] buf = new int[b.getRowBytes()/2*b.getHeight()];

try

{

b.getPixels(buf, 0, b.getWidth(), 0, 0,100, 100);

}

catch(Throwable th)

{

th.printStackTrace();

}

Bitmap d = Bitmap.createBitmap(buf, 100, 100, Config.ARGB_4444);

int c = b.getPixel(99, 99);

int count = d.getByteCount();

Log.e("est", Integer.valueOf(count).toString());
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: