简体   繁体   English

如何使用圆形内的网格在圆形中裁剪图像

[英]How to Crop image in Circle Shape with Grid inside Circle

In my Social media app i want image Cropping Functionality, that Crop image in Circle shape plus have Grid inside Circle.在我的社交媒体应用程序中,我想要图像裁剪功能,圆形裁剪图像加上圆形内的网格。 在此处输入图片说明

I have Already Checked TOCropViewController.but there is no option for Grid.我已经检查了 TOCropViewController.but 网格没有选项。 https://github.com/TimOliver/TOCropViewController https://github.com/TimOliver/TOCropViewController

I find one solution , we can use UIGraphicsGetCurrentContext in CropView and use addEllipse method to draw Circle inside CropView.我找到了一种解决方案,我们可以在 CropView 中使用 UIGraphicsGetCurrentContext 并使用 addEllipse 方法在 CropView 中绘制圆。

this is link For Solution.这是解决方案的链接。 https://github.com/bhaveshbc/CircleCropView https://github.com/bhaveshbc/CircleCropView

在裁剪视图的顶部添加一个CAShapeLayer ,并在该形状图层中添加网格线。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM