Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How can I add icons to my clock face?

I am trying to create a clock face for my wife, and have pretty much everything that I need on it. I was able to get the background image to show up, but can't get the icons for steps, heart rate, etc to show. Does anyone have examples of the files that need to be edited (and how) in order for the icons to show up over the background image? Sorry if this is an obvious answer. I am completely new to all of this.

Best Answer
0 Votes
9 REPLIES 9

Put the images into the resources folder. e.g /resources/image1.png

 

Then in your index.gui file you use the image:

 

 

<image href="image1.png" x="0" y="0" width="100" height="100" />

The order of elements in the index.gui matters, so if you want this image to appear above the background image, it must be added to the file after the background image. Like this:

 

 

<svg>
<image href="background.png" x="0" y="0" width="100%" height="100%" />
<image href="image1.png" x="0" y="0" width="100" height="100" />
</svg>

 

 

Best Answer

I am trying to add more than 1 icon but only the one that is coded first shows up. How do I fix this?

code:

<svg class="background">
<text id="timeLabel" />
<image href="heartRateIcon.png" x="75" y="100" width="30" height="30" />
<text id="heartRateLabel" />
<image href="batteryIcon.png" x="75" y="25" width="30" height="30" />
<text id="batteryLabel" />
</svg>

Best Answer
0 Votes

This looks fine. Did you put the image file in your resources folder? Is the image actually 30x30? The device won't resize big images due to lack of memory.

Best Answer

Thanks, resizing the image worked. But when I use a white image, it just makes it black.

 

Best Answer
0 Votes
Best Answer
0 Votes

Ensure you're using rgb (24-bit) images, rather than greyscale (8-bit).

Peter McLennan
Gondwana Software
Best Answer
0 Votes

Ok, Thanks for the answer!

Best Answer

How is the background image done?

Best Answer
0 Votes

@Ineedhelp_  see - Solved: SVG background image

Author | ch, passion for improvement.

Best Answer
0 Votes