Back

ChooseImage

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

  app.ChooseImage( options, callback )

Example - Choose Image



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

    btnChoose = app.CreateButton( "Choose Image", 0.5, 0.1 );
    btnPhone.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: "internal" or "external" or ""
function(path)