直接上代码;
//5.写一个自定义view(8分)
public class Myview extends View {
Matrix matrix;
Bitmap bitmap;
int width;
int higth;
float sx=0.0f;
float sy=0.0f;
Canvas canvas;
float scale=1.0f;
boolean isone=true;
public Myview(Context context) {
super(context);
init(context);
}
public Myview(Context context, AttributeSet attrs) {
super(context, attrs);
init(context);
}
public Myview(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init(context);
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
@Override
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
super.onLayout(changed, left, top