save()

Description

Saves the image data of DcsImage to file.

Syntax

- (void) save: (NSString *) filename

Parameters

filename:NSString * Specifies the file name to save the image data as.

Return value

Void

Exceptions

Circumstance Exception thrown
There is not enough memory. DcsMemoryLimitException
The file path does not exist or the user doesn't have the right to access it. DcsFilepathInvalidException
There is no data in DcsImage. DcsValueNotValidException

Example


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

    UIImage *UIImg2 = [UIImage imageNamed:@"barcode"];
    DcsImage *DcsImgIcon = [[DcsImage alloc]init:UIImg2];

    NSString *Path = NSTemporaryDirectory();
    Path = [Path stringByAppendingString:@"DCSSaveFolder"];
    NSLog(@"path: %@",Path);
    [DcsImgIcon save:Path];
}

@end