replaceWithImage()

Description

Replaces the data at the specified index of the buffer with the specified DcsImage.

Syntax

(void) replaceWithImage: (DcsImage *) image
index: (NSInteger) index

Parameters

image:DcsImage The image to be added to the buffer.
index:NSInteger The specified index of the image to be replaced.

Return value

Void

Exceptions

Circumstance Exception thrown
Image is nil. DcsValueNotValidException
Image is not DcsImage. DcsTypeNotValidException
The index is not a positive value or it equals / is larger than count. DcsValueOutOfRangeException

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 *Rimg = [UIImage imageNamed:@"twain"];
    DcsImage *DcsRImg = [[DcsImage alloc]init:Rimg];
    [self.dcsView.buffer replaceWithImage:DcsRImg index:1];
}

@end