我有这样的代码:
// ...
public class MyImageView extends ImageView
public MyImageView(Context context, String value /* some other params */) {
super(context);
// some predefines
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
// some preparations
try {
// here I call third party lib like:
someObj.draw(canvas);
// HERE I WANT TO CHANGE COLOR OF SOME PIXELS ACCORDING TO THEIR CURRENT COLOR
} catch (Exception e) {
e.printStackTrace();
}
}
}
代替 UPCASE 字母注释,我想在第三方库绘制后根据它们当前的颜色更改画布上某些像素的颜色。我可以使用canvas.drawPoint(x, y, paint)
设置像素颜色的方法,但我怎样才能获得某些像素的颜色(x,y)
?