imageview.setImageMatrix 不改变图像

发布于 2025-01-04 19:38:54 字数 252 浏览 3 评论 0原文

我正在更改图像矩阵(缩放和拖动)并调用 imageview.setImageMatrix(matrix) 但图像不会更改。

我没有忘记设置:

android:scaleType="矩阵"

xml 文件中的

。我检查了日志,触摸事件被正确拦截+矩阵本身被正确计算。

但仍然...对屏幕上的图像没有影响...

有人遇到过这种奇怪的行为吗?

I am changing the image matrix (zooming and dragging) and calling imageview.setImageMatrix(matrix) but the image won't change.

I didn't forget to set:

android:scaleType="matrix"

in the xml file.

I checked the Log and the touch events are intercepted correctly + the matrix itself is calculated correctly.

but still... no effect on the image on screen....

Did anyone encounter this strange behavior?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

终难遇 2025-01-11 19:38:54

这篇文章可能会帮助您为什么 ImageView.setImageMatrix() 不起作用?
并记住(来自文档)Matrix 没有构造函数,因此必须使用 reset() 显式初始化它 - 构造单位矩阵,或 set..() 函数之一(例如 setTranslate、setRotate、等)。

This post might help you Why does ImageView.setImageMatrix() not work?
and remember (from doc) Matrix does not have a constructor, so it must be explicitly initialized using either reset() - to construct an identity matrix, or one of the set..() functions (e.g. setTranslate, setRotate, etc.).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文