ImageView.ScaleType ="MATRIX"的含义是什么? : 安卓 [英] what is the meaning of ImageView.ScaleType="MATRIX" : Android

查看:129
本文介绍了ImageView.ScaleType ="MATRIX"的含义是什么? : 安卓的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我了解matrix,它的结构以及图像视图的缩放类型.但是,

I know about the matrix, its structure and working about image view's scale-type. but,

  1. 我找不到ImageView.ScaleType="MATRIX"的确切含义.通过声明这一点,在绘制图像视图时会发生什么.

  1. I can't find the exact meaning of ImageView.ScaleType="MATRIX". By declaring this, what exactly happens while drawing the image view.

何时可以使用ImageView.ScaleType="MATRIX"吗?

FIT_END& FIT_START

我对此进行了搜索,还引用了官方链接,但是无法找到确切的答案.

I googled about it and also referred the official link but was not able to find the exact answer.

推荐答案

  1. ImageView.ScaleType.MATRIX使您可以使用Matrix缩放图像.您可以使用ImageView.setImageMatrix(matrix)设置矩阵.因此,通过将 scaleType 声明为 MATRIX ,就意味着您要使用显式矩阵来做到这一点.
  2. 只要您想根据需要自定义图像缩放,旋转等方式,就可以使用imageView.setScaleType(ImageView.ScaleType.MATRIX).
  3. FIT_ENDFIT_START是默认的比例类型.因此,例如,如果使用FIT_END,则图像将保持原始的宽高比,并且将图像视图的右边缘和下边缘的结果对齐.因此,基本上,不同之处在于FIT_ENDFIT_START是预设",而使用MATRIX则声明要使用自己的矩阵进行缩放.
  1. ImageView.ScaleType.MATRIX lets you use a Matrix to scale the image. You can set the Matrix using ImageView.setImageMatrix(matrix). So by declaring the scaleType to MATRIX you are saying that you want to use an explicit Matrix to do that.
  2. You can use imageView.setScaleType(ImageView.ScaleType.MATRIX) whenever you want to customize the way the your image scales, rotates, etc. at your desire.
  3. FIT_END and FIT_START are default types of scale. So, if you use FIT_END for instance, your image will maintain the original aspect ratio and it will align the result of the right and bottom edges of your image view. So basically, the difference is that FIT_END and FIT_START are "presets" while with MATRIX you declare that you want to use your own matrix to scale.

阅读文档以获取更多信息

这篇关于ImageView.ScaleType ="MATRIX"的含义是什么? : 安卓的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆