adjustContrast()

Description

Adjusts the contrast of a document in the editor.

Please note that this function is built-in behind the contrast tool item.

Syntax

- (void) adjustContrast: (NSInteger) contrast

Parameters

(NSInteger) contrast: the amount to increase/decrease the contrast by, ranging from -100 to 100. Negative values indicate decreasing contrast while positive values indicate increasing contrast. Each adjustment made to the document is based on the current contrast.

Return value

void

Exception

Circumstance Exception thrown
The value you set is not between -100 and 100. DcsValueOutOfRangeException
The value you set is nil. DcsValueNotValidException

Example


@interface ViewController ()<DcsUIDocumentEditorViewDelegate>{
    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.documentEditorView.delegate = self; 
    [self.view addSubview:dcsView];

    [self.dcsView.documentEditorView adjustContrast:20];
}

@end

Is this page helpful?

Leave a Reply

Your email address will not be published.