[Android Q&A, Help & Troubleshooting] satishdasyam:
When the user touches a view i need to scale that view and show that scaled view of that point in a circle as shown in the image .But when i am using matrix and do scaling instead of touch point area i am getting other one .The question is how do i calculate a same point after scaling on scaled view.

Please see the attached images and guide me where i am going wrong if there is a better solution please provide me.

The car image is target and the wall image is my work i must implement the same zooming here

My code

import java.util.ArrayList;
import java.util.Timer;
import java.util.TimerTask;

import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.BitmapShader;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.DashPathEffect;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.PointF;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.Shader.TileMode;
import android.os.Environment;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.widget.ImageView;
import android.widget.Toast;

public class PaintView extends ImageView {

public static ArrayList<Float> xPoints;
public static ArrayList<Float> yPoints;
private Canvas mCanvas;
public static Path mPath;
public static Path mPath1;
public static Path mPath2;
public static Path mPath3;
public static Path mPath4;

Context mContext;

private Paint mPaint = new Paint();
private Paint pPaint = new Paint();
boolean isEndReached;
public static float startX, startY, prevX, prevY;
long prevTime;
Timer t;
TimerTask task;
Context mcontext;
private float mX, mY;

float prevCX = 0f;
float prevCY = 0f;

public static ArrayList<android.graphics.Point> points, points1, points2,
points3, points4;
private static final float TOUCH_TOLERANCE = 4;
public static ArrayList<Point> pointArray, pointArray1, pointArray2,
pointArray3, pointArray4;

private Bitmap bmp;
private BitmapShader shader;
private Matrix matrix = new Matrix();;
private Paint shaderPaint;
PointF zoomPos;

PointF mid = new PointF();

PointF start = new PointF();
boolean isDrawingStarted;

//RectF rect;

public PaintView(Context context, AttributeSet attrs) {
super(context, attrs);
mcontext = context;

String filePath = Environment.getExternalStorageDirectory()
+ "/test.png";
BitmapFactory.Options options = new BitmapFactory.Options();
//options.inPurgeable = true;
bmp = BitmapFactory.decodeFile(filePath, options);
AppUtils.LOG("------ bitmap ------- " + bmp);
bmp = Bitmap.createScaledBitmap(bmp, AppUtils.IMG_WIDTH,
AppUtils.IMG_HEIGHT, true);

zoomPos = new PointF();
shader = new BitmapShader(bmp, TileMode.CLAMP, TileMode.CLAMP);

shaderPaint = new Paint();
shaderPaint.setShader(shader);

}

[MENTION=439709]override[/MENTION]
public boolean onTouchEvent(MotionEvent event) {

float x = event.getX();
float y = event.getY();

switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
touch_start(x, y);
if (t != null) {
t.cancel();
}
zoomPos.x = event.getX();
zoomPos.y = event.getY();
matrix.reset();
matrix.postScale(1.5f, 1.5f, zoomPos.x, zoomPos.y);

shader.setLocalMatrix(matrix);
invalidate();
break;
case MotionEvent.ACTION_MOVE:
touch_move(x, y);
zoomPos.x = event.getX();
zoomPos.y = event.getY();
matrix.reset();
matrix.postScale(1.5f, 1.5f, zoomPos.x, zoomPos.y);
shader.setLocalMatrix(matrix);
invalidate();
break;
case MotionEvent.ACTION_UP:
touch_up(x, y);
reScheduleTimer();
invalidate();
break;
case MotionEvent.ACTION_POINTER_DOWN:
midPoint(mid, event);
invalidate();
break;
}
this.setImageMatrix(matrix);
return true;
}

[MENTION=439709]override[/MENTION]
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);

if (isDrawingStarted) {
canvas.drawCircle(zoomPos.x, zoomPos.y, 110, shaderPaint);
}

}

}