save()

Description

Saves the image data of DcsImage to file.

Syntax

func save(filename:String)

Parameters

filename:String Specifies the file name to save the image data as.

Return value

Void

Exceptions

Circumstance Exception thrown
There is not enough memory. DcsMemoryLimitException
The file path does not exist or the user doesn't have the right to access it. DcsFilepathInvalidException
There is no data in DcsImage. DcsValueNotValidException

Example

class ViewController: UIViewController {
override func viewDidLoad() {
        super.viewDidLoad()
        var str = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask,true)
    let Path = str[0] + "/xxx.xxx"   //Please replace "xxx.xxx" with the file name of the image you need to save. 
    }
}

Is this page helpful?

Leave a Reply

Your email address will not be published.