cut()

Description

Cuts an area of the image in the editor. The remaining area is left as white once cut.

Syntax

- (void) cut: (NSInteger) x1
top: (NSInteger) y1 right: (NSInteger) x2 bottom: (NSInteger) y2

Parameters

(NSInteger) left: specifies the x-coordinate of the upper-left corner of the rectangle.
(NSInteger) top: specifies the y-coordinate of the upper-left corner of the rectangle.
(NSInteger) right: specifies the x-coordinate of the lower-right corner of the rectangle.
(NSInteger) bottom: specifies the y-coordinate of the lower-right corner of the rectangle.

Return value

void

Remarks

If the value of left or top is negative, it will be treated as zero.

If the value of right is larger than the width of image, it will be treated as the width of image.

If the value of bottom is larger than the height of image, it will be treated as the height of image.

The value of left must be smaller than the value of right and the value of right must be positive. Otherwise, the method will throw DcsValueNotValidException.

The value of top must be smaller than the value of bottom and the value of bottom must be positive. Otherwise, the method will throw DcsValueNotValidException.

Example


@interface ViewController ()<DcsUIImageEditorViewDelegate>{
    DcsView *dcsView;
}
@end
 
@implementation ViewController
 
- (void)viewDidLoad {
    [super viewDidLoad];
     
    dcsView = [[DcsView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
 
    dcsView.imageEditorView.delegate = self; 
    [self.view addSubview:dcsView];

    [self.dcsView.imageEditorView cut:10 top:10 right:200 bottom:200];
}

@end