2016-04-28 130 views
0

我需要裁剪圖像,從一些自定義形狀(如心,星,..),但我沒有找到任何這樣做的Android庫。自定義圖像裁剪android

一個非常好的圖書館是這https://github.com/MostafaGazar/CustomShapeImageView 我可以把我的形狀的svg文件,但我不能裁剪圖像,因爲這是一個簡單的ImageView。

有沒有這樣的庫?我怎麼能解決這個問題?

編輯#1:

我想所有要做到這一點的方法..但現在我需要知道,如果有轉換SVG文件或位圖文件到Android的「路徑」變量的方式

回答

0

使用這一個:

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

加上 依賴

{ compile 'com.github.siyamed:android-shape-imageview:[email protected]' 
} 

,並應用任何形狀:

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

      android:background="@color/transparent" 
/> 
+0

的問題是,我想移動和保存剪裁的圖片與我已經決定 – diegocom

+0

所以組織你的問題的形狀。 –

+0

你好,你知道如何在Android中使心臟形狀cropview。 –