initWithFile()

Description

Creates a DcsImage object from a file.

Syntax

func initWithFile(filename:String)

Parameters

filename:String Specifies the file name to create the DcsImage from.

Return value

Any

Remarks

For multi-page files like multi-page tiff or PDF, it will create the object from the first page.

Exceptions

Circumstance Exception thrown
There is not enough memory. DcsMemoryLimitException
The file does not exist. DcsFileNotFoundException
It fails to read the file. DcsFileReadException
The data can't be decoded or the file is not an image. DcsDataFormatInvalidException
filename is nil. DcsValueNotValidException
filename is not String. DcsTypeNotValidException

Example


class ViewController:UIViewController { 
override func viewDidLoad() {
    super.viewDidLoad()
    var uiImage=UIImage(named:"auto.png")
}
}