lecui 1.0.0-alpha.20
lecui C++ user interface library
|
Splash screen class. Useful for displaying graphics while app is loading. More...
#include <splash.h>
Public Member Functions | |
splash (form &fm) | |
Constructor. More... | |
~splash () | |
Destructor. | |
bool | display (int png_resource, bool dpi_aware, std::string &error) |
Display splash screen image. More... | |
void | remove () |
Remove splash screen image. | |
Splash screen class. Useful for displaying graphics while app is loading.
liblec::lecui::splash::splash | ( | form & | fm | ) |
Constructor.
fm | A reference to the form. |
bool liblec::lecui::splash::display | ( | int | png_resource, |
bool | dpi_aware, | ||
std::string & | error | ||
) |
Display splash screen image.
png_resource | The ID of the PNG resource containing the image. |
dpi_aware | Whether the splash screen scales the image automatically based on the DPI scale. |
error | Error information. |
To use the same image and have it appear the same size on screens with different DPI settings set the dpi_aware flag to true. However, if you would like to have only a sharp, pixel-perfect splash screen it is recommended to set the flag to false and (optionally) load a different resource based on the dpi scale reported through the form::get_dpi_scale() method. For example, you may have three different images: one for 1.0 up to 1.5 scale, another for 1.75 to 2.25 and then another for 2.50 and beyond.