//Called when application is started.
function OnStart()
{
//Create a layout with objects vertically centered.
lay = app.CreateLayout( "Linear", "FillXY" );
//Create a blank image.
img = app.CreateImage( null, 0.8, 0.8 );
lay.AddChild( img );
//Add layout to app.
app.AddLayout( lay );
//Draw our picture.
DrawPicture();
}
function DrawPicture()
{
//Fill image with solid white.
img.SetColor( "#ffffffff" );
img.DrawImage( "/Sys/Img/Hello.png", 0.2, 0.5, 0.2, 0.2);
}
Try:
function DrawPicture()
{
//Fill image with solid white.
img.SetColor( "#ffffffff" );
var hello =app.CreateImage( "/Sys/Img/Hello.png");
img.DrawImage( hello,0.2, 0.5, 0.2, 0.2);
}