ExportPicture

From Xojo Documentation
Jump to: navigation, search
Method

Exports an object of type Picture.


Syntax

result=ExportPicture(pic)

Part Type Description
result Boolean True if the picture was saved successfully; False if the picture was not saved.
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. When the user chooses a format, the appropriate extension is automatically added 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.


macOS

The jpeg and png formats are supported on macOS.


Linux

The BMP format is supported on Linux.

Examples

The following code allows the user to save a picture. The jpeg file type has already been defined as a File Type using either the FileType class or the File Types Sets Editor in the IDE. It is referred to by the name of the object.

Dim p as Picture
Dim r as Boolean
Dim f as FolderItem
f= GetOpenFolderItem(FileTypes1.Jpeg)
If f <> Nil then
p=Picture.open(f)
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.

Personal tools
Namespaces

Variants
Actions
Main
Content
Starting Out
Dig Deeper
More Help
Toolbox
About