Difference between revisions of "Picture.Save"
From Xojo Documentation
|Line 74:||Line 74:|
Latest revision as of 16:12, 7 October 2019
Saves the picture in file specified by file, using the file format specified by format. For the list of available formats, see Picture.Formats.
|Only JPEG and PNG are supported in console applications|
If the FolderItem exists, then it will be overwritten by the new picture file.
If you are using the JPEG format, then there is an optional parameter for the quality of the JPEG. You specify the quality using the following class constants.
The following example saves the contents of an ImageWell to a temporary file on disk and then reads it into a BinaryStream for storage in a database. The property f as FolderItem is a property of the window.
Var bs As BinaryStream
Var f As FolderItem
If ImageWell1.Image <> Nil Then
// Get a temporary file to save the image to
If Picture.IsExportFormatSupported(Picture.FormatJPEG) Then
f = SpecialFolder.Temporary.Child("TempImage.jpg")
// Save the image out to the file
// Open the file as a BinaryStream and read the data in
bs = BinaryStream.Open(f, False)
If bs <> Nil Then
imageData = bs.Read(bs.Length)
// delete the temporary file if it exists
If f.Exists Then