Lame - Can't get image background

Former Member
Former Member
Hi,

very new at this.

My png is 218*218, respecting the color chart, modest in size.

Initially had the image in an image directory with a specific resource file. As it did not work, I now have in drawables.xml :
<drawables>
<bitmap id="LauncherIcon" filename="launcher_icon.png" />
<bitmap id="background" filename="FF5500.png" />
</drawables>

In the View.mc file, I have:
class MyView extends Ui.WatchFace {

var background;

function initialize() {
WatchFace.initialize();
background = Ui.loadResource(Rez.Drawables.background);
}

//! Load your resources here
function onLayout(dc) {
setLayout(Rez.Layouts.WatchFace(dc));
}

//! Called when this View is brought to the foreground. Restore
//! the state of this View and prepare it to be shown. This includes
//! loading resources into memory.
function onShow() {

dc.drawBitmap(0, 0, background);
}

//! Update the view
function onUpdate(dc) {
// Get and show the current time
dc.drawBitmap(0, 0, background);
var clockTime = Sys.getClockTime();
var timeString = Lang.format("$1$:$2$", [clockTime.hour, clockTime.min.format("%02d")]);
var view = View.findDrawableById("TimeLabel");
view.setText(timeString);

// Call the parent onUpdate function to redraw the layout
View.onUpdate(dc);
}

That's basically a cc from the sample so cannot get what goes wrong

Thanks for your help

Fred