GetImage

The GetImage function Returns full path to micro:bit board top view image micro-bit.png.

Return is string: “/data/user/0/com.smartphoneremote.androidscriptfree/app_Plugins/microbit/micro-bit.png”

It could be used as visualization of board. It is used by MicroBitCtrl.

// Load the MicroBit plugin.
app.LoadPlugin( "MicroBit" );
 
// Called when application is started.
function OnStart()
{
  // Lock screen orientation to Portrait.
  app.SetOrientation( "Portrait" );
 
  // Create our main layout.
  lay = app.CreateLayout( "Linear", "VCenter,FillXY" );
  lay.SetBackColor( "#222222" );
 
  // Create the Microbit plugin.
  microbit = app.CreateMicroBit();
 
  // Creates micro:bit board image with 90% of layout width
  img = app.CreateImage( microbit.GetImage(), 0.9, -1 );
  lay.AddChild( img );  
 
  //Add main layout to the app.
  app.AddLayout( lay );
}