Closed belinwu closed 7 years ago
@belinwu Hello :) Thank you for your interest of my project.
Answer of your question is I'm sorry. This project don't support to change crop rect size. Many other android image crop project change crop rect size but they can't move image. So I make this project. If you need to change crop rect size, I recommend aviary sdk. That project is not complete open source. but I think that help you.
Thank you :D
@helloyako Thank you for your reply. :)
I don't mean that change crop rect size by fingers.
I know crop rect is fixed, but I wanna config this fixed area size in xml to implement the following screenshot:
The crop rect's right and left have some transparent spaces. It looks like than the crop rect has margins.
Thank you :D
@belinwu Ah! I misunderstood your question. so sorry. Currently,That you want can't be now. I think it is not difficult work for your need. But I don't have time so I can't immediately do that. also you can fix that and pull request that It’s a good way.
@helloyako Finally, you got me. :) Thank you! :D
@belinwu Thank you :)
@belinwu Long time no see :) Finally, I finished your request. (code change : cd174ba10c1798ec9280174060ac8cae5220c6d4) I'm sorry to keep you waiting for long time.
I will include this spec in v1.2.0. but it's not released.
You can use 1.2.0-snapshot or develop branch source code.
repositories {
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
dependencies {
compile 'com.naver.android.helloyako:imagecropview:1.2.0-SNAPSHOT'
}
<com.naver.android.helloyako.imagecrop.view.ImageCropView
xmlns:imagecrop="http://schemas.android.com/apk/res-auto"
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="visible"
imagecrop:setInnerGridMode="on"
imagecrop:gridInnerStroke="1dp"
imagecrop:gridInnerColor="#66ffffff"
imagecrop:setOuterGridMode="on"
imagecrop:gridOuterStroke="1dp"
imagecrop:gridOuterColor="#ffffff"
imagecrop:gridLeftRightMargin="10dp"
imagecrop:gridTopBottomMargin="10dp"/> <!-- see gridLeftRightMargin or gridTopBottomMargin -->
gridLeftRightMargin When crop area width and crop view width is equal, use gridLeftRightMargin
gridTopBottomMargin When crop area height and crop view height is equal, use gridTopBottomMargin
I hope it helps
@helloyako : Would u please tell me How to Change imagecrop:gridLeftRightMargin and imagecrop:gridTopBottomMargin in Java Code ??
@karimabdelhameed I'm sorry I'm late answer java code doesn't provide setGridLeftRightMagin(gridTopBottomMargin)
I will provice java code in next version
resolved v1.2.0
@helloyako Good job! Thank you!
Currently, crop frame will match parent, I wanna change crop rect size.
By the way, this project is awesome.
Thank you!