This shows you the differences between two versions of the page.
plugins:microbit_getimage [2016/10/25 09:47] madlyr Added micro:bit board image |
plugins:microbit_getimage [2016/10/25 17:48] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== GetImage ====== | ||
- | |||
- | The **GetImage** function Returns full path to micro:bit board top view image micro-bit.png. | ||
- | |||
- | Return is string: "/ | ||
- | |||
- | {{: | ||
- | |||
- | It could be used as visualization of board. It is used by MicroBitCtrl. | ||
- | |||
- | <code javascript> | ||
- | // Load the MicroBit plugin. | ||
- | app.LoadPlugin( " | ||
- | |||
- | // Called when application is started. | ||
- | function OnStart() | ||
- | { | ||
- | // Lock screen orientation to Portrait. | ||
- | app.SetOrientation( " | ||
- | |||
- | // Create our main layout. | ||
- | lay = app.CreateLayout( " | ||
- | lay.SetBackColor( "# | ||
- | |||
- | // Create the Microbit plugin. | ||
- | microbit = app.CreateMicroBit(); | ||
- | |||
- | // Creates micro:bit board image with 90% of layout width | ||
- | img = app.CreateImage( microbit.GetImage(), | ||
- | lay.AddChild( img ); | ||
- | |||
- | //Add main layout to the app. | ||
- | app.AddLayout( lay ); | ||
- | } | ||
- | </ | ||