Picture.IsImportFormatSupported

From Xojo Documentation

You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!
Shared Method

Picture.IsImportFormatSupported(format as Formats) As Boolean

New in 2010r3

Supported for all project types and targets.

Returns True if the passed format is supported for import.

Notes

BMP, GIF and TIFF formats are not supported for Console apps.

Sample Code

This example checks to see if a format is supported for import prior to calling it:

Var width As Integer = 2000
Var height As Integer = 2000

// creates new picture
Var pic As New Picture(width, height)

Var picFile As FolderItem
picFile = FolderItem.ShowOpenFileDialog("image/jpeg")
If Picture.IsImportFormatSupported(Picture.Formats.JPEG) Then
If f <> Nil Then
pic = Picture.Open(picFile)
ImageWell1.Image = pic
End If
End If