Picture.IsExportFormatSupported

From Xojo Documentation
Jump to: navigation, search
Shared method
Picture.IsExportFormatSupported ( format as String ) As Boolean
Introduced 2010r3

Returns True if the passed format is supported for export.

Notes

The valid formats are:

  • Picture.FormatBMP
  • Picture.FormatGIF
  • Picture.FormatJPEG
  • Picture.FormatPNG
  • Picture.FormatTIFF


Example

This example checks to see that the format is supported for export prior to calling it.

Dim imageData As String
Dim bs As BinaryStream
Dim 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
ImageWell1.Image.Save(f, Picture.SaveAsJPEG)
End If

// 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)
bs.Close
End if

// delete the temporary file if it exists
If f.Exists Then
f.Delete
End If
End If
Personal tools
Namespaces

Variants
Actions
Main
Documentation
Community
Toolbox
Help