init()

Description

Creates a DcsImage object from UIImage.

Syntax

- (id) init: (UIImage *) image

Parameters

image:UIImage * The image data to create the object from.

Return value

ID

Remarks

When image is nil, the exception DcsValueNotValidException will be thrown.

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];
}

@end