Back

ChooseImage

Hello World

ChooseImage opens the photo gallery for user to select an image.

app.ChooseImage( options, callback )

See Also: CreateImage

Example - Choose Image

function OnStart()
{
    lay = app.CreateLayout( "linear", "VCenter,FillXY" );

    btnChoose = app.CreateButton( "Choose Image", 0.5, 0.1 );
    btnChoose.SetOnTouch( btnChoose_OnTouch );
    lay.AddChild( btnChoose );

    app.AddLayout( lay );
}

function btnChoose_OnTouch()
{
    app.ChooseImage( "internal", OnChoose );
}

function OnChoose( path )
{
    alert( "image path: " + path );
}
    Copy     Copy All       Run      
string: comma “,” separated: “” or “internal” or “external”
function( path )