@Override protected void onDraw(Canvas calque) { this.setImageMatrix(ImageControls.getInstance().getTransformationMatrix()); // mCanvas.setMatrix(ImageControls.getInstance().getTransformationMatrix()); // mCanvas.drawPath(mPath, mPaint); // calque.drawBitmap(bitmap, 0, 0, mPaint); this.setImageBitmap(bitmap); super.onDraw(calque); }
public boolean onTouch(View arg0, MotionEvent event) { ImageControls ctrls = ImageControls.getInstance(); float x = event.getX() / ctrls.scale - ctrls.tx; float y = event.getY() / ctrls.scale - ctrls.ty; switch (event.getAction()) { case MotionEvent.ACTION_DOWN: touch_start(x, y); invalidate(); break; case MotionEvent.ACTION_MOVE: touch_move(x, y); invalidate(); break; case MotionEvent.ACTION_UP: touch_up(); invalidate(); break; } return true; }