[id] = ImageRequest(id[, type])
id
. If you specify Nil in the id
argument,
ImageRequest()
will automatically choose an identifier for the brush and return
the identifier to you.
The optional type argument allows you to specify the image source to use when prompting the user for an image. This can currently be set to one of the following predefined constants:
#REQ_GALLERY:
#REQ_CAMERA:
The default mode is #REQ_GALLERY
, i.e. ImageRequest()
will prompt the user to select
an image from the device's gallery.
To find out if this function has failed because the user cancelled the image requester,
just use HaveObject() to see if the brush object exists after
ImageRequest()
returns. If it doesn't exist, the user has cancelled the image
requester. See HaveObject for details.
#REQ_GALLERY
ImageRequest(1, #REQ_CAMERA) If HaveObject(#BRUSH, 1) DisplayBrush(1, #CENTER, #CENTER) Else NPrint("Requester cancelled!") EndIfThe code above prompts the user to take a picture with the camera and then displays this picture. It also checks if the requester has been cancelled.