Back

GetThumbnail

Hello World

Creates a downscaled copy of an existing image.

app.GetThumbnail( source, destination, width, height )

Pass -1 as width or height to keep the aspect ratio.

See Also: CreateImage

Example - Create Thumbnail

function OnStart()
{
    lay = app.CreateLayout( "absolute" );

    img = app.CreateImage( "/Sys/Img/Hello.png" );
    lay.AddChild( img );

    app.GetThumbnail( "/Sys/Img/Hello.png", "/sdcard/Hello_thmb.png", 100, -1 );
    thmb = app.CreateImage( "/sdcard/Hello_thmb.png" );
    lay.AddChild( thmb );


    app.AddLayout( lay );
}
    Copy     Copy All       Run      
number: pixel
string: path to file or folder ( “/absolute/...” or “relative/...” )