lecui 1.0.0-alpha.20
lecui C++ user interface library
Public Member Functions | List of all members
liblec::lecui::splash Class Reference

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.
 

Detailed Description

Splash screen class. Useful for displaying graphics while app is loading.

Constructor & Destructor Documentation

◆ splash()

liblec::lecui::splash::splash ( form fm)

Constructor.

Parameters
fmA reference to the form.

Member Function Documentation

◆ display()

bool liblec::lecui::splash::display ( int  png_resource,
bool  dpi_aware,
std::string &  error 
)

Display splash screen image.

Parameters
png_resourceThe ID of the PNG resource containing the image.
dpi_awareWhether the splash screen scales the image automatically based on the DPI scale.
errorError information.
Returns
Returns true if successful, else false (in which case error information if written to the "error" parameter.

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.


The documentation for this class was generated from the following file: