Introduction
The WebUI shows an application logo at the top left of the window, to the left of the application name, when you set it in a theming stylesheet. This article shows how. The feature is available in AIMMS 4.85 and newer.
The image above comes from the Employee Scheduling example. You can use that example to try the steps below.
Adding the logo
Put the logo image in the folder
MainProject\WebUI\resources\imagesof your project, for exampleapp-logo.svg.Create a stylesheet in the folder
MainProject\WebUI\resources\stylesheets, for exampletheming.css, with the following contents:/* Application logo in the header, left of the application name. --bg_app-logo : <left offset> <vertical position> / <width> <height> no-repeat url(<image>) --spacing_app-logo_width : the space reserved for the logo; without it, no logo is shown. /app-resources/ maps to the MainProject/WebUI folder. */ :root { --bg_app-logo: 8px 50% / 32px 32px no-repeat url(/app-resources/resources/images/app-logo.svg); --spacing_app-logo_width: 48px; }
Reload the WebUI.
Sizing the logo
Reserve the space. Without
--spacing_app-logo_width, no logo is shown. Make it at least the left offset plus the logo width, here 8 + 32 = 40 pixels. The example reserves 48 pixels, to leave a margin to the application name.Keep the aspect ratio of the image. A square logo can be shown at 32 x 32 pixels. A wide logo of 435 x 96 pixels (ratio 4.53 : 1) is shown at 145 x 32 pixels, with
--spacing_app-logo_widthof at least 8 + 145 = 153 pixels.Keep it sharp. An SVG image stays sharp at any size. For a PNG image, use two or three times the displayed size, so the logo stays sharp on high-resolution screens.
Mind the header. The height of the header limits the height of the logo.
The path.
/app-resources/maps to the folderMainProject\WebUI. That is why the path to the image containsresources/images.
For more options, see A special case: the application logo in the WebUI documentation.
See also
Converting a WinUI Application to WebUI: when you convert a WinUI application, the logo of the WinUI splash screen moves to the WebUI header.
Add a Logo to a WebUI App (aimms 4.84 and Older), for AIMMS 4.84 and older (deprecated).