From cdd0f5bac374778e72f70e1809d7ed33a17c52cb Mon Sep 17 00:00:00 2001 From: Ian Gray Date: Mon, 3 Jan 2022 20:19:24 +0000 Subject: [PATCH] Note that images can be displayed with Labels --- README.md | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ae21387..e8c5726 100644 --- a/README.md +++ b/README.md @@ -215,7 +215,17 @@ on creation and a initial value. The name is not changeable once the UI initialised. Labels automatically wrap your text. If you want them to have multiple lines use -the normal `
` tag in the string you print to the label +the normal `
` tag in the string you print to the label. + +In fact, because HTML can be used in the label's value, you can make a label display +images by including an `` tag. + +``` + ESPUI.label("An Image Label", ControlColor::Peterriver, ""); +``` + +This requires that the client has access to the image in question, either from the internet or a local web server. + #### Slider @@ -364,7 +374,7 @@ be used to refect a warning state by changing the color of a button, or for simi For example, this code will set a control's panel to a random background color: ``` - char stylecol[30] + char stylecol[30]; sprintf(stylecol, "background-color: #%06X;", (unsigned int) random(0x0, 0xFFFFFF)); ESPUI.setPanelStyle(switch1, stylecol); ``` @@ -373,7 +383,7 @@ You can get quite creative with this. ![Inline Styles](docs/inlinestyles.gif) -Note: The images in this example are formed by setting a Label to contain an tag: +Note: The images in this example are formed by setting a Label to contain an `` tag: ``` ESPUI.addControl(ControlType::Label, "Label", "", ControlColor::Peterriver);