随着Android的不断壮大,你想要的很多控件在github上基本都能找到,对于爱折腾的我来说,闲暇之余更喜欢自己倒腾,之前博客有提到想研究图片这一块,今天就来折腾一下编辑图片.
先来实现在一张图片上坐标注,也就是说我可以在一张图片上乱画
在一张图片上乱花,首先要有一张图片,然后要有只画笔实现乱花
先把图片放上:
public class DrawPicture extends View{
private Paint mPaint;
private Bitmap mBitmap;
public DrawPicture(Context context) {
this(context, null);
}
public DrawPicture(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public DrawPicture(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
mBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.credit);
}
@Override
protected void