【问题标题】:Custom image cropper android自定义图像裁剪器android
【发布时间】:2016-04-28 18:09:05
【问题描述】:

我需要以一些自定义形状(如心形、星形等)裁剪从图库中获取的图像,但我还没有找到任何可以执行此操作的 android 库。

一个非常好的库是这个https://github.com/MostafaGazar/CustomShapeImageView 我可以在其中放置我的形状的 svg 文件,但我无法裁剪图像,因为那是一个简单的 ImageView。

有没有图书馆可以做到这一点?我该如何解决这个问题?

编辑#1:

我正在尝试所有方法来做到这一点.. 但现在我需要知道是否有办法将 svg 文件或位图文件转换为 android“路径”变量

【问题讨论】:

    标签: android image imageview crop shape


    【解决方案1】:

    使用这个:

    https://github.com/siyamed/android-shape-imageview

    添加 依赖关系

    { compile 'com.github.siyamed:android-shape-imageview:0.9.+@aar'
    }
    

    并应用任何形状:

        <com.github.siyamed.shapeimageview.HexagonImageView
                android:id="@+id/my_imageview"
                android:layout_width="90dp"
                android:layout_height="90dp"
    
                android:background="@color/transparent"
     />
    

    【讨论】:

    • 问题是我想用我决定的形状移动并保存裁剪的图像
    • 所以整理你的问题。
    • 你好,你知道如何在android中制作心形cropview。
    猜你喜欢
    • 2013-04-17
    • 2023-03-12
    • 1970-01-01
    • 1970-01-01
    • 2021-12-03
    • 2012-02-05
    • 1970-01-01
    • 2017-05-18
    • 1970-01-01
    相关资源
    最近更新 更多