Picture.Open

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.

Example

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

Dim picFile As FolderItem
picFile = GetOpenFolderItem("")

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