AndroidOS 中的 imageview.getImageMatrix() 在 HarmonyOS 中的替代方法是什么

问题描述

在 Android 中,我们将在 imageView 上使用 getimageMatrix( ) 方法,该方法返回视图的可选矩阵。这在绘制时应用于视图的可绘制对象。如果没有矩阵,该方法将返回一个单位矩阵。
在安卓中

Matrix matrix = imageView.getimageMatrix( ).

HarmonyOS 中此代码片段的替代方法是什么?

解决方法

正如@AIMIN 所指出的,目前 Harmony 没有 ImageView.getImageMatrix() 的确切替代方案。

但是我们将能够为 Image 组件计算 getImageMatrix()。参考这个PhotoView实现

https://gitee.com/openharmony-tpc/PhotoView/blob/master/library/src/main/java/com/github/chrisbanes/photoview/PhotoView.java