2019-12-02 05:58:26 +01:00
|
|
|
# icon Image
|
|
|
|
|
|
|
|
Create an icon [image](/reference/images/image) for the [LED screen](/device/screen).
|
|
|
|
|
|
|
|
```sig
|
|
|
|
images.iconImage(IconNames.Heart);
|
|
|
|
```
|
|
|
|
|
|
|
|
There are lots of pre-made icon images you can use to display on the [LED screen](/device/screen) of the @boardname@. You choose an icon by its name.
|
|
|
|
|
|
|
|
## Parameters
|
|
|
|
|
|
|
|
* **i**: the icon name of the image you want to show on the [LED screen](/device/screen). You pick an icon image such as: `IconNames.Heart`.
|
|
|
|
|
|
|
|
## Example
|
|
|
|
|
|
|
|
Show a happy face when button A is pressed or a sad face when button B is pressed.
|
|
|
|
|
|
|
|
```blocks
|
|
|
|
let iamHappy = images.iconImage(IconNames.Happy)
|
|
|
|
let iamSad = images.iconImage(IconNames.Sad)
|
|
|
|
|
2020-08-19 22:03:58 +02:00
|
|
|
input.onButtonPressed(Button.A, () => {
|
2019-12-02 05:58:26 +01:00
|
|
|
iamHappy.showImage(0);
|
|
|
|
});
|
2020-08-19 22:03:58 +02:00
|
|
|
input.onButtonPressed(Button.B, () => {
|
2019-12-02 05:58:26 +01:00
|
|
|
iamSad.showImage(0);
|
|
|
|
});
|
|
|
|
```
|
|
|
|
|
|
|
|
## See also
|
|
|
|
|
|
|
|
[arrow image](/reference/images/arrow-image)
|