init()

Description

Creates a DcsDocument object from UIImage.

Syntax

func init(image:UIImage)

Parameters

image:UIImage The image data to create object from.

Return value

Any

Remarks

When image is not nil, it will detect the boundary of the document, process it and return the DcsDocument object.

Exceptions

Circumstance Exception thrown
Image is nil DcsValueNotValidException

Example

class ViewController: UIViewController, DcsUIVideoViewDelegate {
    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)
        var uiImage = UIImage(named: "xxx")
        var dcsDocument = DcsDocument.init(uiImage)
    }
}
Is this page helpful?