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());
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());
相关文章推荐
- Android真机调试的时候logcat中无法输出调试信息的解决办法
- android 实现地图定位功能
- Android活动的启动模式
- TextVie获取显示字符串的宽度之Android开发
- android AsyncTask介绍
- android实用技巧:android实现listview异步加载图片
- Android 四大组件学习之ContentProvider一
- Android版本和API Level对应关系
- android webview js交互 第一节 (java和js交互)
- Android代码内存优化建议-OnTrimMemory优化
- android中获取 bitmap 像素的颜色 之吸管取色功能
- android获取View上某点的颜色
- Android客户端向服务器端发送数据的流程(1)
- Android ArrayAdapter 详解
- Android 如何修改PrograssBar的背景图片?
- Android
- 麦子学院android老师分享android实现listview异步加载图片的方法
- Android GridView中Item宽高不正常的问题解决
- Android Google购买PHP服务器端验证(订阅购买和一次性购买)
- android开发入门笔记:AIDL简单入门