用手指随便拖。这里采用了线程去绘制,其实也可以在onTouch中绘制。
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Point;
import android.graphics.Rect;
import android.graphics.Region;
import android.util.Log;
import android.view.MotionEvent;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.View;
import android.view.View.OnTouchListener;
import com.ql.app.R;
public class AppView extends SurfaceView implements SurfaceHolder.Callback,Runnable,OnTouchListener{
private static final String tag="AppView";
private Context context;
private SurfaceHolder holder;
private Bitmap icon;
private Paint paint;
private boolean running=true;
public AppView(Context context) {
super(context);
// TODO Auto-generated constr