Back

ScanFile

JS Py
Hello World

Forces android to scan an image file to appear in the phone's gallery.

app.ScanFile( file )

See also: CreateImage, CreateCameraView, ScreenShot.

Example - Add Image to Gallery

function OnStart()
{
    img = app.CreateImage( null, 1, 1 );
    img.SetPaintColor( "green" );
    img.DrawCircle( 0.5, 0.5, 0.3 );
    img.Save( app.GetAppPath() + "/circle.jpg" );

    app.ScanFile( "circle.jpg" );
    app.ChooseImage();
}
from native import app

def OnStart():
    img = app.CreateImage( None, 1, 1 )
    img.SetPaintColor( "green" )
    img.DrawCircle( 0.5, 0.5, 0.3 )
    img.Save( app.GetAppPath() + "/circle.jpg" )

    app.ScanFile( "circle.jpg" )
    app.ChooseImage()
Copy All       Run      
String: path to file ( “/absolute/...” or “relative/...” )