How to draw a circle after zoom in android(如何在android放大后画一个圆圈)
问题描述
我正在使用图像视图并使用 layerDrawable 绘制覆盖图像.我使用了两个位图 original 和 myBitmap.缩放后我无法在正确的位置绘制圆圈,它是在不同的位置绘制的.
I am using Image view and drawing overlay image using layerDrawable. I have used two bitmaps original and myBitmap. After zoom I am not able draw circle in correct location, it's drawn in different location.
这是我正在使用的代码,
This is the code I am using,
请帮助我.缩放后我需要在正确的位置画圆.
Kindly help me. I need to draw circle in correct location after zoom.
任何帮助将不胜感激.
推荐答案
您能否添加显示您想要获得的内容的图片和显示您获得的内容的图片?
Could you add images showing what it is you're trying to get and a pic showing what you get instead?
要记住的一点是,某些操作对 y 轴使用不同的零点.我一直在在表面视图上的矩阵运算上与此作斗争,在那里我必须计算一个校正因子,因为一个操作使用视图的顶部作为 y=0,而矩阵操作使用视图的底部作为 y=0,所以实际的矩阵运算需要类似:matrixY = (totalHeightY - Yposition).
One thing to keep in mind is that certain operations use a different zero point for the y axis. I've been fighting this on matrix operations on a surfaceview, where I've had to calculate a correction factor because one operation used the top of the view as y=0 and the matrix operation used the bottom of the view as y=0, so the actual matrix operation needed something like: matrixY = (totalHeightY - Yposition).
但显示您的期望和您得到的结果将有助于更快地诊断问题,而不是运行和处理您的代码:)
But showing what you expect and what you're getting would help diagnose the problem quicker than running and working through your code :)
这篇关于如何在android放大后画一个圆圈的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!