insertImage()

Description

Inserts an image into DcsBuffer at the index.

Syntax

- (void) insertImage: (DcsImage *) image
index: (NSInteger) index

Parameters

image:DcsImage The image data to be inserted.
index:NSInteger The index to insert the image.

Return value

Void

Remarks

If the index equals 0, the image object will be added at the beginning of DcsBuffer.
If the index equals count, the image object will be added at the end of DcsBuffer.

Exceptions

Circumstance Exception thrown
index < 0 or index > count DcsValueOutOfRangeException
Image is not DcsImage. DcsTypeNotValidException
Image is nil. 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 *Rimg = [UIImage imageNamed:@"barcode"];
    DcsImage *DcsRimg = [[DcsImage alloc]init:Rimg];
    [self.dcsView.buffer insertImage:DcsRimg index:1];
}

@end