0

I want to change the design for border corner of BJImageCropper like this Sample Image, can anyone help me on this ?

Currently I am using this code for initialize 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];

If there is any other framwork for image cropping that has the border corner like the sample image ,that might help also.

4

1 回答 1

0

我使用了 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"]]; 

其中.png类似于这个

并使用以下代码在我的代码中实现了该框架:

[[BFCropInterface alloc]initWithFrame:self.cropView.bounds andImage:original nodeRadius:50];

增加 的值nodeRadius以增加角点图像的大小。

于 2016-05-11T07:32:18.907 回答