{"id":3790,"date":"2025-04-21T09:48:58","date_gmt":"2025-04-21T09:48:58","guid":{"rendered":"https:\/\/webprojects.cloud\/wordpress\/splatco\/?post_type=spl_knowledgebase&#038;p=3790"},"modified":"2025-06-10T06:20:11","modified_gmt":"2025-06-10T06:20:11","slug":"resetibgimage-bbgcolour-hash-function","status":"publish","type":"spl_knowledgebase","link":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/resetibgimage-bbgcolour-hash-function\/","title":{"rendered":"# Reset({i:BGImage}{, b:BGColour}) hash function"},"content":{"rendered":"\n<p>Valid for use with hash command:&nbsp;<code><a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/\">HMI<\/a>. <\/code>Arguments may be specified as&nbsp;<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/namevalue-pairs-in-hash-functions\/\">Name:Value Pairs<\/a><\/p>\n\n\n\n<p>Implemented on the following platforms: HMi430, Android, Windows (with no arguments).<\/p>\n\n\n\n<p>Restores the&nbsp;<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/glossary-of-terms\/#o5243\">HMI<\/a>&nbsp;to its initial state. The&nbsp;<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/glossary-of-terms\/#o5380\">SimpleHMI<\/a>&nbsp;in SPLat\/PC also has a button for doing this, to assist debugging.<\/p>\n\n\n\n<p><code>BGImage<\/code>&nbsp;is an optional background image file name. If the image file is found, it will form the background (be positioned behind everything else).<\/p>\n\n\n\n<p><code>BGColour <\/code>is an optional background colour specifier in&nbsp;<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/colours\/\">ARGB-Hex format<\/a>.<\/p>\n\n\n\n<p>The interaction between the image and colour are defined in this table:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>Image<\/td><td>Colour<\/td><td>Effect<\/td><\/tr><tr><td>No<\/td><td>No<\/td><td>Background colour is set to black, any existing image is removed<\/td><\/tr><tr><td>No<\/td><td>Yes<\/td><td>Background colour is set, any existing image is removed<\/td><\/tr><tr><td>Yes<\/td><td>No<\/td><td>The image is displayed and the background colour is set to transparent<\/td><\/tr><tr><td>Yes<\/td><td>Yes<\/td><td>The background colour, with alpha, appears in front of the image.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Example:<\/p>\n\n\n\n<p>This program will display a background image, some text over the image, and a button. It is written for the SPLat EC1 using an&nbsp;<a href=\"https:\/\/www.google.com.au\/search?q=HC06+Bluetooth+adaptor&amp;oq=HC06+Bluetooth+adaptor&amp;aqs=chrome..69i57j0.486j0j4&amp;sourceid=chrome&amp;es_sm=122&amp;ie=UTF-8\">HC-06 Bluetooth adaptor<\/a>&nbsp;at 9600BPS, talking to an Android device.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">HMIPort         EQU     252\t\t;Bluetooth on port 252 on EC1<br>#       <a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/hash-commands-and-functions\/open_serial-hash-command\/\">Open_Serial<\/a> Port(HMIPort) User(9600,8,N)   <br>#       HMI <a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/hash-commands-and-functions\/open_serial-hash-command\/portp-hash-function\/\">Port<\/a>(HMIPort)  ConnectEvent(evBGImage)<br>        GoSub           evBGImage    \t;Paint the display at startup<br>        LaunchTask      tskNULL\t\t;A do-nothing task, because I must have something!<br>        RunTasksForever<br>;--------------------------------------------------<br>;Clear the screen, display background and a message. This \"event handler\" subroutine is run<br>;at startup and whenever an <a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/glossary-of-terms\/#o5369\" target=\"_blank\" rel=\"noreferrer noopener\">Enduser<\/a> clicks the Refresh button on the device screen.<br>evBGImage:<br># HMI   Reset(i:\"flower.jpg\")\t;Reset the screen, display a background image    <br># HMI   HideAllButtons()         ;Get rid of the default buttons<br># HMI   <a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/hmi-deprecated-functions\/setbgcolorrred-ggreen-bblue-aalpha-hash-function\/\">SetBGColour<\/a>(20, 20, 120)  <a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/hmi-deprecated-functions\/setfgcolorrred-ggreen-bblue-aalpha-hash-function\/\">SetFGColour<\/a>(255, 0, 255) ;Set a default background, in case the image file is absent <br># HMI   Cls()                    ;Remove existing text, set the screen background colour if the image fails<br># HMI   Cursor(15, 5) SetBGColour(255, 0, 0, 0)  ;Note the BGColour has a 4th parameter, Alpha (transparency)<br># HMI   Text(\"Text with transparent background\")    <br># HMI   <a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/buttoneventid-row-col-height-width-text-mode-clickhandler-hash-function\/\">ButtonEvent<\/a>(, -2, -10, 2, 10, \"Refresh\", evBGImage)<br>        Return<br><br>tskNULL:   ;There must be at least one running task for SimpleHMI to work.<br>        YieldTask<br>        GoTo            tskNULL<\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"384\" height=\"640\" src=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2025\/04\/Reset.jpg\" alt=\"\" class=\"wp-image-3792\" srcset=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2025\/04\/Reset.jpg 384w, https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2025\/04\/Reset-180x300.jpg 180w, https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2025\/04\/Reset-64x107.jpg 64w\" sizes=\"auto, (max-width: 384px) 100vw, 384px\" \/><\/figure>\n\n\n\n<p>The above program will only work if the named image file is present on the Android device, in the default application image folder &#8211; see&nbsp;<code><a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/setimagepathpathname\/\">SetImagePath<\/a><\/code>. You will need to place your own image in the device and ensure the name matches that in the program. If it is not there, the background will be a solid colour. You can experiment with the effects of not finding the image by renaming the file in the Android device (or in the program).<\/p>\n\n\n\n<p>Note: File names in Android are case-sensitive.<\/p>\n\n\n\n<p>To use the program on an MMi203, MS120, CC18 or other 8-bit SPLat board with a single serial port shared between programming and Bluetooth, change the first 2 lines to the following:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">HMIPort         EQU     251\t\t;Bluetooth on port 251 on MMi203, MS121, CC18, SL100 etc.<br>#       <a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/programming-reference\/instructions-arranged-by-function\/hash-commands-and-functions\/open_serial-hash-command\/\">Open_Serial<\/a> Port(HMIPort) User(38400,8,N)   ;Higher baudrate on these boards<\/pre>\n\n\n\n<p>See also&nbsp;<code><a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/setimagepathpathname\/\">SetImagePath<\/a>, <\/code>which describes file paths and their management.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Valid for use with hash command:&nbsp;HMI. Arguments may be specified as&nbsp;Name:Value Pairs Implemented on the following platforms: HMi430, Android, Windows (with no arguments). Restores the&nbsp;HMI&nbsp;to&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":3768,"menu_order":13,"template":"","class_list":["post-3790","spl_knowledgebase","type-spl_knowledgebase","status-publish","hentry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title># Reset({i:BGImage}{, b:BGColour}) hash function - SPLat Controls<\/title>\n<meta name=\"robots\" content=\"noindex, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"# Reset({i:BGImage}{, b:BGColour}) hash function - SPLat Controls\" \/>\n<meta property=\"og:description\" content=\"Valid for use with hash command:&nbsp;HMI. Arguments may be specified as&nbsp;Name:Value Pairs Implemented on the following platforms: HMi430, Android, Windows (with no arguments). Restores the&nbsp;HMI&nbsp;to...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/resetibgimage-bbgcolour-hash-function\/\" \/>\n<meta property=\"og:site_name\" content=\"SPLat Controls\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-10T06:20:11+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2025\/04\/Reset.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"384\" \/>\n\t<meta property=\"og:image:height\" content=\"640\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/resetibgimage-bbgcolour-hash-function\/\",\"url\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/resetibgimage-bbgcolour-hash-function\/\",\"name\":\"# Reset({i:BGImage}{, b:BGColour}) hash function - SPLat Controls\",\"isPartOf\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/resetibgimage-bbgcolour-hash-function\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/resetibgimage-bbgcolour-hash-function\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2025\/04\/Reset.jpg\",\"datePublished\":\"2025-04-21T09:48:58+00:00\",\"dateModified\":\"2025-06-10T06:20:11+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/resetibgimage-bbgcolour-hash-function\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/resetibgimage-bbgcolour-hash-function\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/resetibgimage-bbgcolour-hash-function\/#primaryimage\",\"url\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2025\/04\/Reset.jpg\",\"contentUrl\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2025\/04\/Reset.jpg\",\"width\":384,\"height\":640},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/resetibgimage-bbgcolour-hash-function\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Deprecated\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"# HMI Android &#038; Windows\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"# Reset({i:BGImage}{, b:BGColour}) hash function\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website\",\"url\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/\",\"name\":\"SPLat Controls\",\"description\":\"OEM Embedded Machine Controllers\",\"publisher\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#organization\",\"name\":\"SPLat Controls\",\"url\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2024\/10\/logo.svg\",\"contentUrl\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2024\/10\/logo.svg\",\"caption\":\"SPLat Controls\"},\"image\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"# Reset({i:BGImage}{, b:BGColour}) hash function - SPLat Controls","robots":{"index":"noindex","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"og_locale":"en_US","og_type":"article","og_title":"# Reset({i:BGImage}{, b:BGColour}) hash function - SPLat Controls","og_description":"Valid for use with hash command:&nbsp;HMI. Arguments may be specified as&nbsp;Name:Value Pairs Implemented on the following platforms: HMi430, Android, Windows (with no arguments). Restores the&nbsp;HMI&nbsp;to...","og_url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/resetibgimage-bbgcolour-hash-function\/","og_site_name":"SPLat Controls","article_modified_time":"2025-06-10T06:20:11+00:00","og_image":[{"width":384,"height":640,"url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2025\/04\/Reset.jpg","type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/resetibgimage-bbgcolour-hash-function\/","url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/resetibgimage-bbgcolour-hash-function\/","name":"# Reset({i:BGImage}{, b:BGColour}) hash function - SPLat Controls","isPartOf":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/resetibgimage-bbgcolour-hash-function\/#primaryimage"},"image":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/resetibgimage-bbgcolour-hash-function\/#primaryimage"},"thumbnailUrl":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2025\/04\/Reset.jpg","datePublished":"2025-04-21T09:48:58+00:00","dateModified":"2025-06-10T06:20:11+00:00","breadcrumb":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/resetibgimage-bbgcolour-hash-function\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/resetibgimage-bbgcolour-hash-function\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/resetibgimage-bbgcolour-hash-function\/#primaryimage","url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2025\/04\/Reset.jpg","contentUrl":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2025\/04\/Reset.jpg","width":384,"height":640},{"@type":"BreadcrumbList","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/resetibgimage-bbgcolour-hash-function\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/"},{"@type":"ListItem","position":2,"name":"Deprecated","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/"},{"@type":"ListItem","position":3,"name":"# HMI Android &#038; Windows","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/deprecated\/hmi-android-windows\/"},{"@type":"ListItem","position":4,"name":"# Reset({i:BGImage}{, b:BGColour}) hash function"}]},{"@type":"WebSite","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website","url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/","name":"SPLat Controls","description":"OEM Embedded Machine Controllers","publisher":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webprojects.cloud\/wordpress\/splatco\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#organization","name":"SPLat Controls","url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#\/schema\/logo\/image\/","url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2024\/10\/logo.svg","contentUrl":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2024\/10\/logo.svg","caption":"SPLat Controls"},"image":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/spl_knowledgebase\/3790","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/spl_knowledgebase"}],"about":[{"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/types\/spl_knowledgebase"}],"author":[{"embeddable":true,"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/users\/1"}],"up":[{"embeddable":true,"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/spl_knowledgebase\/3768"}],"wp:attachment":[{"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/media?parent=3790"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}