android+Bitmap + options

public void getPixels (int[] pixels, int offset, int stride, int x, int y, int width, int height)

把位图的数据拷贝到pixels[]中。每一个都由一个表示颜色值的int值来表示。幅度参数表明调用者允许的像素数组行间距。对通常的填充结果,只要传递宽度值给幅度参数。
参数
pixels      接收位图颜色值的数组
offset      写入到pixels[]中的第一个像素索引值
stride      pixels[]中的行间距个数值(必须大于等于位图宽度)。可以为负数
x           从位图中读取的第一个像素的x坐标值。
y           从位图中读取的第一个像素的y坐标值
width      从每一行中读取的像素宽度
height    读取的行数              
异常
IilegalArgumentExcepiton       如果x,y,width,height越界或stride的绝对值小于位图宽度时将被抛出。
ArrayIndexOutOfBoundsException          如果像素数组太小而无法接收指定书目的像素值时将被抛出。

inJustDecodeBounds      decodeFile      inSampleSize

 

requestLayout 和 invalidate

recycle

 

related links:

http://ranlic.iteye.com/blog/1313735  //introduce getPixels function

http://blog.csdn.net/fengyee_zju/article/details/18101351  // the solution to get the RGB from pixel

http://www.tuicool.com/articles/63emAv  //about options

http://www.cnblogs.com/hellope/archive/2011/08/23/2150400.html //options

http://blog.csdn.net/lonelyroamer/article/details/7569248  //recycle

http://blog.csdn.net/wawxf2008/article/details/8459365  // requestLayout 和 invalidate

1、以专家为榜样,不必自己重新探索
2、解构技能,找出实现80%效果的那20%
3、不要一心二用
4、练习练习再练习!然后获得即时反馈
5、坚持,不要在低谷期放弃
原文地址:https://www.cnblogs.com/zhongyuan/p/4223611.html