TextureView.setTransform(Matrix transform)方法的作用

今天在学习Github上大佬的代码的时候,发现了一个方法Texture.setTransform()

    /**
     * <p>Sets the transform to associate with this texture view.
     * The specified transform applies to the underlying surface
     * texture and does not affect the size or position of the view
     * itself, only of its content.</p>
     * 设置要与此texture view关联的变换。指定的转换应用于surface texture,
     * 不影响视图的大小或位置本身,只是它的内容
     *
     * <p>Some transforms might prevent the content from drawing
     * all the pixels contained within this view's bounds. In such
     * situations, make sure this texture view is not marked opaque.</p>
     * 某些转换可能会阻止绘制内容此view的边界内包含的所有像素。在这样的
     * 情况下,请确保此TextureView未标记为不透明
     *
     * @param transform The transform to apply to the content of
     *        this view.
     *        转换要应用于的view的内容
     *
     * @see #getTransform(android.graphics.Matrix)
     * @see #isOpaque()
     * @see #setOpaque(boolean)
     */
    public void setTransform(Matrix transform) {
        mMatrix.set(transform);
        mMatrixChanged = true;
        invalidateParentIfNeeded();
    }

(注释翻译源自百度翻译)

从源码上看就是说本方法修改的并不是view本身的大小,只是其中画面内容会发生改变。

那么画面内容会发生何种变化呢?比如大小变化、画面旋转角度变化等(详情可以参见->Android中的Matrix

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章