嗨,我想创建一个可以加载大图像的应用程序,并且我可以通过简单的手势移动它。我必须将图像打印出来,但我无法实现 onTouch,因此它保持静止。任何帮助。谢谢
我绘制图片的代码:
@Override protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
Paint paint = new Paint();
paint.setStyle(Paint.Style.FILL);
// make the entire canvas white
paint.setColor(Color.WHITE);
canvas.drawPaint(paint);
paint.setStrokeWidth(1);
paint.setPathEffect(null);
paint.setColor(Color.GRAY);
paint.setAntiAlias(true);
for (int i=1; i < 100; i++){
canvas.drawLine(0, i*1 , 600, i*20, paint);
canvas.drawLine(i*1 ,0, i*20, 600, paint);
}
}