Search code examples
javaandroidhuawei-mobile-serviceshuawei-developersharmonyos

What is the alternative method in HarmonyOS for imageview.getImageMatrix( ) in AndroidOS


In Android we will use getImageMatrix( ) method on imageView which returns view's optional matrix. This is applied to the view's drawable when it is drawn. If there is no matrix, this method will return an identity matrix.
In Android:

Matrix matrix = imageView.getImageMatrix( ).

What is the alternative for this code snippet in HarmonyOS?


Solution

  • As @AIMIN pointed out, currently Harmony don't have exact alternative for ImageView.getImageMatrix().

    But we will be able to compute getImageMatrix() for an Image Component. Refer this PhotoView Implementation

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