UserGuide

iOS Picture Picker

From Xojo Documentation

A Picture Picker provides a way for the user to choose an existing picture from the camera roll, photo library, or they can choose to take a new picture. This control does not have UI that displays on the layout so it appears in the Shelf when dragged to the layout.

iOS Picture Picker Library Icon

Below are commonly used events, properties and methods. Refer to iOSPicturePicker in the Language Reference for the complete list.

Events

Cancelled

Called when the user cancels picking a picture.

Selected

Called when the user selects a picture or takes a picture. The picture is provided as a parameter.

Properties

IsEditable

Enables some basic editing controls in the Picture Picker.

Source

Specifies the where the user can choose the picture from using the Sources enum: Camera, CameraRoll, PhotoLibrary.

Methods

Show

Displays the Picture Picker. You have to provide the parent view.
Using the iOS Picture Picker

Usage

This code lets the user pick a picture from the photo library:

PicturePicker1.Source = iOSPicturePicker.Sources.PhotoLibrary
PicturePicker1.Show(Self)

This code in the Selected event handler displays the selected picture in an Image View:

MyImageView.Image = pic

Example Projects

  • Examples/iOS/Controls/PicturePicker

See Also

iOSPicturePicker class; UserGuide:iOS UI topic