ConstraintLayout (二)

ImageFilterView和 ImageFilterButton

兩個屬性
    app:roundPercent="0.98" //取值0-1
    app:round="30dp"  //優(yōu)先級大于 roundPercent

但 ImageFilterButton的效果大打折扣,它有范圍限制,你把 round設(shè)置成無限大,也它不會成個圓形,但 ImageFilterViewt則不一樣可能看著像個圓形

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".activity.ConstraintLayoutAct">

    <androidx.constraintlayout.utils.widget.ImageFilterView
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        android:layout_marginTop="30dp"
        android:background="#aa0000"
        app:roundPercent="0.98"
        app:round="30dp"
        android:layout_width="80dp"
        android:layout_height= "80dp"/>


</androidx.constraintlayout.widget.ConstraintLayout>

效果


image.png
交叉淡化效果
image.png

image.png
調(diào)整亮度
image.png

image.png

image.png
調(diào)節(jié)色溫:


image.png

正常:原圖:


image.png

熱:
image.png
飽和度
image.png

原圖:


image.png

飽和度加大


image.png
對比度:
image.png

原圖:


image.png

對比度加大


image.png
注意:

app:blendSrc="@drawable/shape_blend_src_drawable" 這個屬性是無用的,可以在xml中寫出 但無用,在源碼中可以求證 并沒有設(shè)置此drawable的方法,所以不要浪費時間在上面了。

這個也可以參考一下:
https://blog.csdn.net/u013700502/article/details/142737720

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容