Back

ScreenShot

Hello World

Takes a screen shot of your app and saves it to the specified path.

app.ScreenShot( fileName, quality )

Quality is an optional percentage value for jpg files defaulting to 95.

See also: GetMediaFile

Example - Take Screenshot

function OnStart()
{
    lay = app.CreateLayout( "linear" );
    img = app.CreateImage( null, 1, 1 );
    img.SetPaintColor( "green" );
    img.DrawCircle( 0.5, 0.5, 0.3 );
    lay.AddChild( img );
    app.AddLayout( lay );

    app.ScreenShot( "/sdcard/file.jpg" );
    img.SetImage( "/sdcard/file.jpg" );
}
    Copy     Copy All       Run      
number: percent
string: path to file or folder ( “/absolute/...” or “relative/...” )