[英]Objective-C framework BJImageCropper Border corner
我想像這樣的示例圖像那樣更改BJImageCropper邊框角的設計,有人可以幫我嗎?
目前,我正在使用此代碼初始化BJImageCropper:
self.imageCropper = [[BJImageCropper alloc] initWithImage:self.image andMaxSize:CGSizeMake(750,350)];
self.imageCropper.center = self.cropView.center;
self.imageCropper.imageView.layer.shadowColor = [[UIColor blackColor] CGColor];
self.imageCropper.imageView.layer.shadowRadius = 3.0f;
self.imageCropper.imageView.layer.shadowOpacity = 0.8f;
self.imageCropper.imageView.layer.shadowOffset = CGSizeMake(1, 1);
[self.imageCropper addObserver:self forKeyPath:@"crop" options:NSKeyValueObservingOptionNew context:nil];
如果還有其他帶有邊框角(例如樣本圖像)的圖像裁剪框架,這也可能會有所幫助。
我使用了BFCropInterface ,它實際上是BJImageCropper的修改版本。 您將在BFCropInterface中獲得BJImageCropper的所有委托方法。
替換為BFCropInterface.m中的以下部分
UIImage *nodeImage = [UIImage imageNamed:@"node.png"];
tlnode = [[UIImageView alloc]initWithImage:nodeImage];
trnode = [[UIImageView alloc]initWithImage:nodeImage];
blnode = [[UIImageView alloc]initWithImage:nodeImage];
brnode = [[UIImageView alloc]initWithImage:nodeImage];
有了這個 :
tlnode = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"top-left.png"]];
trnode = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"top-right.png"]];
blnode = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"bottom-left.png"]];
brnode = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"bottom-right.png"]];
並使用以下代碼在我的代碼中實現了該框架:
[[BFCropInterface alloc]initWithFrame:self.cropView.bounds andImage:original nodeRadius:50];
增加nodeRadius
的值以增加角圖像的大小。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.