How to crop image in circular shape in android? - android

I want to crop selected image in circular shape from gallery. I have checked few solution for same question, but I am not able to solve my issue. Maximum solution provide for custom shape imageview means provide a .xml file or class extends with Imageview but I want to crop image like following screenshot or Instagram app crop image.

If you do not mind to use a library.Use SimpleCropView library,it has circle crop mode.
https://github.com/IsseiAoki/SimpleCropView

Related

Moving an image inside in other frame image android

I have a frame image and another image selected from gallery. What i want is to place that image inside the transparent part of that frame image and also I can apply onTouchListener on the image selected from gallery.
Like in the app whose link is provided following.
https://play.google.com/store/apps/details?id=com.lyrebirdstudio.pipcamera
Any idea or concept will be helpful.
My IDEA
Here is what i am thinking to create a relative layout and setting the Picture Frame as a background and then scaling the other image according to the size of the relative layout. Then i can apply onTouchlistener on the image easily.
Am i going in right direction or there is some better way though which i can achieve the desire results?
Thanks in advance.
http://stacktips.com/tutorials/android/how-to-drag-a-view-in-android
OR
how to drag an image by touching in android?
hope it helps..

How to crop an image into a circle button in xml Android studio? [duplicate]

This question already has answers here:
Crop square image to circle - Programmatically
(7 answers)
Closed 7 years ago.
hey guys so I'm trying to make this circle button. And in that circle I want to put an image, like a person's profile picture. So if someone uploads an image, I need to be able to adjust the size and crop it and put it into a circle. Below is an example of what I am trying to accomplish. And behind the circle is a red circle, just for aesthetics. Hope you guys can give me some insight or direction.
You can do this easily by using ImageView two properties: background and src
Get a square image with transparent circle
Set step 1 image to the src property of an ImageView
Set the background of your ImageView with your avatar photo (square).
Please see here for the static avatar image solution:
ImageView in circular through xml
If your avatar is dynamic, then you need to set the background image dynamically and this post will help:
Changing image view background dynamically
If you are using Picaso then use this:
android: create circular image with picasso
However it has great performance concerns.

How to change image cropping frame?

I want to change image cropping frame for my android project. I have now image1 but I need image2 please help me.
You can use Cropper image cropping tool .
It provides a way to set an image in XML and programmatically, and displays a resizable crop window on top of the image. Calling the method getCroppedImage() will then return the Bitmap marked by the crop window.
https://github.com/edmodo/cropper I think this is helpful for this question. I have solved my problem from this .

How to modify image appearance in Image View?

In my app I am getting image from URL and showing in an ImageView. I get a circle shape(blue color) image which is in a square(white color) background. I want to show my image just as a circle ..How to remove or hide the extra white color in that image within my app?
Below is the image for reference:
You should first remove the white part of image in an image editor like Photoshop or Gimp. Making background transparent won't work because white part is not background, It's in image.
Alternatively, You can create a round Imageview if you want your square images to be shown as circular (e.g. profile pictures on Google+). There is a working code snippet here for rounded ImageView How to create a circular ImageView in Android?
Alternatively, if you don't want to use this snippet, you can use a library that will make it easy to create rounded ImageViews. see this
https://github.com/vinc3m1/RoundedImageViewā€ˇ

Implementing a crop image in Android

I am trying to implement a crop image for my app.
What I want to do is that I've an imageview set to 300x300 .I am taking images from
CAMERA and GALLERY now the images can be bigger than 300x300. I want to implement
a cropping tool using which I can drag the image inside imageview so that I can select the useful portion of 300x300 of the image.
I want to implement the same feature which this app implemented for cropping.
Can anyone point me in the right direction ?
Try this:
https://github.com/biokys/cropimage
But if you want to drag and fit useful portion of a image in a Imageview than you can use MultiTouch View.
https://code.google.com/p/android-multitouch-controller/
You can move the image on a custom view. Zoom and Pinch. Once you found the useful area. Take a screenshot of the imageview.
hope any of the solutions helps :)

Categories

Resources