Picture.Open

From Xojo Documentation

Revision as of 20:10, 22 November 2019 by Gperlman (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Shared Method

Picture.Open(file As FolderItem) As Picture

Supported for all project types and targets.

Opens the passed FolderItem to be read as a Picture. Returns a Picture on success. If the FolderItem passed is nil, a NilObjectException is raised. If Picture.Open fails for any other reason, Nil is returned with no other error information.

Example

The following example prompts you to select a file and then opens it and displays it in an ImageWell:

Var picFile As FolderItem
picFile = FolderItem.ShowOpenFileDialog("")

If picFile <> Nil And picFile.Exists Then
Var pic As Picture
pic = Picture.Open(picFile)
ImageWell1.Image = pic
End If