Android 在可触摸图像视图中绘制固定位置圆

Android 在可触摸图像视图中绘制固定位置圆,android,canvas,bitmap,imageview,Android,Canvas,Bitmap,Imageview,我使用的是支持位图缩放和拖动的touchmageview 我想有一个类似于当前地图应用程序的功能:在长时间单击感兴趣的区域后放置一个Pin图标,您可以缩放和拖动地图进行查看,但Pin图标的位置在您感兴趣的点上是稳定的 现在我可以从imageView.setOnLongClickListener开始,通过imageView.draw(canvas),在imageView.setOnLongClickListener中编码来画一个圆圈,简化如下: zoomedRect = imageView.get

我使用的是支持位图缩放和拖动的
touchmageview

我想有一个类似于当前地图应用程序的功能:在长时间单击感兴趣的区域后放置一个Pin图标,您可以缩放和拖动地图进行查看,但Pin图标的位置在您感兴趣的点上是稳定的

现在我可以从
imageView.setOnLongClickListener
开始,通过
imageView.draw(canvas)
,在
imageView.setOnLongClickListener中编码来画一个圆圈,简化如下:

zoomedRect = imageView.getZoomedRect();
currentZoom = imageView.getCurrentZoom();
Rect imageBounds = ((BitmapDrawable) imageView.getDrawable())
                        .getBounds();
// height and width of the visible (scaled) image
int scaledHeight = imageBounds.height();
int scaledWidth = imageBounds.width();

// draw circle only accept the absolute coordinate in an
// image area, so need a transfer.
currentAbsoluteTop = zoomedRect.top * scaledHeight
                        + lastClickedY_CapturedInOnTouch / currentZoom;
currentAbsoluteLeft = zoomedRect.left * scaledWidth
                        + lastClickedX_CapturedInOnTouch / currentZoom;

// save the circle coordinate to my image view.
imageView.drawCircleByXandY(currentAbsoluteLeft,
                        currentAbsoluteTop);
MyTouchImageView中的
draw(Canvas Canvas)
(继承自
TouchImageView
)基本上与继续传输相反,并且它可以工作

现在的问题是,一旦我放大或拖动ImageView,圆圈就会飞起来,我注意到如果我为不同的比例位图选择不同的
ImageVeView.setScaleType
,行为会有所不同

有人能帮忙吗