AGK for Pascal
ContentsIndexHome
PreviousUpNext
TAgkImage.ChooseASync Method (TAgkObject, TAgkImageEvent)

Presents the user with an option to choose an image stored on their current platform, for example a photo on a phone or an image saved on a PC. This does not immediately capture the image, but fires a notification event when the user has finished or cancelled the selection.

Syntax
Pascal
class procedure ChooseASync(const Owner: TAgkObject; const OnImageChosen: TAgkImageEvent); overload; static;
Parameters 
Description 
const Owner: TAgkObject 
the object that will become owner of the chosen image (eg. a TAgkScene object). 
const OnImageChosen: TAgkImageEvent 
this event will be fired when the user has finished choosing an image, or cancelled the operation. 

Depending on the platform your app may continue running in the background whilst the user is choosing an image, or it may pause execution whilst the image is chosen. In any case you must assume your app continues running but is no longer visible. 

When the user closes the dialog box, the OnImageChosen event is fired. If the dialog box was cancelled, the Image parameter of this event will be nil. Otherwise, it will be the newly loaded image. 

There is another version of ChooseASync that doesn't use an event, but instead you must poll for completion.

Copyright (c) 2012. All rights reserved.