ExportPicture Function

Exports an object of type Picture.

Syntax

result = ExportPicture( pic )


Parameters

pic

Picture

A picture.



Notes

When ExportPicture is called, it displays a save-file dialog box so the user can save the picture in any directory. The user can also use the dialog box to choose a picture format. If QuickTime is installed (Windows and Macintosh), the available choices are: BMP, PICT, PhotoShop, JPEG, PNG, SGI, TGA, TIFF, and QuickTime image. When the user chooses a format, REALbasic adds the appropriate suffix to the filename.

ExportPicture returns True if the picture was saved; if the user clicks cancel, ExportPicture returns False.

Windows

The BMP format is supported on Windows. For all other formats, QuickTime is required.

Macintosh

The PICT format is supported on Macintosh. For all other formats, QuickTime is required.

Linux

The BMP format is supported on Linux.


Example

The following code allows the user to save a picture. The file type "bmp' has already been defined as a File Type using either the FileType class or the File Types Sets Editor in the IDE.

Dim p as Picture
Dim r as Boolean
Dim f as FolderItem
f=GetOpenFolderItem("bmp")
If f {} Nil then
p=f.OpenAsPicture
r=ExportPicture(p)
If r then
   MsgBox "Your picture was saved."
else
   MsgBox "Your picture was not saved."
end if
End if

See Also

Picture, FolderItem classes.