From Xojo Documentation

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.


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