replaceWithImage()

Description

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

Syntax

func replaceWithImage(image:DcsImage, index:Int)

Parameters

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

Return value

Void

Exceptions

Circumstance Exception thrown
Image is nil. DcsValueNotValidException
Image is not DcsImage. DcsTypeNotValidException
Index is not a positive value smaller than count. DcsValueOutOfRangeException

Example

class ViewController: UIViewController{
    var dcsView:DcsView!
    override func viewDidLoad() {
        super.viewDidLoad()
        dcsView = DcsView(frame: CGRect(x:0,y:0,width:self.view.frame.size.width,height:self.view.frame.size.height))
        view.addSubview(dcsView)
        let dcsImage = DcsImage.init(UIImage(named: "xxx"))
        dcsView.buffer.replace(with:dcsImage, index:1)
    }
}
Is this page helpful?

Leave a Reply

Your email address will not be published.