Crop Image with Ionic 3 Camera ( Square => Circle)

#1

Hello everyone,
I want crop an image with circle frame. But I use ionic’s camera, it can only show square frame. How to change the shape of the frame ?

#2

What do you want to do with the circled image? It might be easier to just display the square picture behind a circle mask.

#3

I want the image of the frame to be a circle to accurately represent the outward image as a circle like an avatar.

#4

Ok, so it has to be that way during taking the photo?

#5

Yes, sir. I want show crop view with circle frame after taking a photo.

#6

After taking the photo or during taking the photo?
After is easy: Just add a mask on top of the picture which is only transparent in the middle circle.
During is harder, as you have to adapt the plugin you are using to show the camera a differnet way.

#7

I want to find a solution to reuse the crop functions. How to add mask on top of crop view
but we don’t need to create another class ?

#8

Croppie

This seems to have an option for a circular crop, I would give it a try

#9

hello,
if there is only the need that you show only same parts of an image, then css clip methode is maybe what you are looking for . Qucik and easy see here http://bennettfeely.com/clippy/
How to add, change or remove css class dynamically you can use ngClass or ngStyle.

Best regrads ,a nna-liebt

#10

i can’t use it in ionic 3.

#11

it’s a plugin native i can’t not use this css.

#12

Hello,
hmmm, maybe I understood it wrong, but how do you display the image after taken? If you show it in a html container, then you can use css.
Best regards, anna-liebt

1 Like
#13

They want to display the circle when taking the photo. That will probably require modifications on the native code of whatever camera plugin they are using.

#14

Yes, Sir. I use this screen of native camera plugin and i want change frame of native code.

#15

Then you will have to tell us which plugin you are using for the camera, and then we can do you work and see if there is a built-in way to change the overlay. If not, you will have to fork the plugin and do that yourself.