Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can I only show the crop rectangle? #37

Closed
gordon-lim opened this issue Mar 9, 2019 · 9 comments
Closed

Can I only show the crop rectangle? #37

gordon-lim opened this issue Mar 9, 2019 · 9 comments

Comments

@gordon-lim
Copy link

I want to hide off the parts of the image that is outside of the crop window. Is that possible. I want the imagecropview to be just the final image.

@helloyako
Copy link
Contributor

Hello, @bongbonglemon

First, Thank you for contact me.

As far as I understand your question, you don't want to see transparent layer.
Is that right?

If that's right, it's not possible now.

But if we will edit code little bit, it will be possible.

as-is to-be
as-is to-be

@gordon-lim
Copy link
Author

Thanks for the reply. I actually also want to be able to change the colour of the area in the view that is not the cropped image to say white. I think if these changes were made it would be closer to that of Instagram's. Thanks again for the reply.

P.S After making that post, I actually went into the library's code and narrowed it down to the drawTransparentLayer() method. I went on to learn a bunch about Android Canvas haha :) I'm rather new to Android.

@helloyako
Copy link
Contributor

Good.
to-be image only changed color of layer to black.(removed alpha)
so I think it's enough this library provide setTransparentLayerColor() method to solve your question.

@gordon-lim
Copy link
Author

Yep sounds good. Look forward to the change. Thanks!

@helloyako
Copy link
Contributor

I have made PR #38 for this request.

However, I didn't add setTransparentLayerColor() method.

I added attribute for outsideLayer color.

You can check this attribute in 1.2.2-SNAPSHOT

snapshot version from maven

repositories {
    maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
dependencies {
   implementation 'com.naver.android.helloyako:imagecropview:1.2.2-SNAPSHOT'
}

@gordon-lim
Copy link
Author

Failed to resolve the dependency :/

@helloyako
Copy link
Contributor

Did you add snapshots repository?

repositories {
    maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}

helloyako added a commit that referenced this issue Mar 22, 2019
* #37 Add attribute that is outsideLayerColor

* 1.2.2
@helloyako
Copy link
Contributor

I released v1.2.2

@gordon-lim
Copy link
Author

gordon-lim commented Mar 22, 2019

woops sorry for no reply. it wasn't really exactly what i wanted even after the last update so i decided to try and work on implementing the custom image view myself. tot it will be a fun project that i can learn much from. but thanks for the release yo. i hope it helps other developrs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants