Home » Community » Newbie corner » [SOLVED]How I can put an image in a form like a splash screen?? ([SOLVED]How I can put an image in a form like a splash screen??)
Re: How I can put an image in a form like a splash screen?? [message #52688 is a reply to message #52687] |
Mon, 11 November 2019 08:15   |
Oblivion
Messages: 1214 Registered: August 2007
|
Senior Contributor |
|
|
The idea is same.
struct SplashScreen : TopWindow {
Image img;
void Paint(Draw& w) override
{
if(!IsNull(img)) w.DrawImage(0, 0, img);
}
SplashScreen()
{
img = StreamRaster::LoadFileAny("/home/user/mypicture.png");
CenterScreen().SetRect(img.GetSize());
}
};
The problem is if you are calling the system draw (via Ctrl::Paint) then the image should better be opened elsewhere, as I did above, otherwise it will hurt performance (on every single refresh the file will be reloaded, and decoded.
Best regards,
Oblivion
Github page: https://github.com/ismail-yilmaz
Bobcat the terminal emulator: https://github.com/ismail-yilmaz/Bobcat
|
|
|
Goto Forum:
Current Time: Sat Jul 12 04:56:03 CEST 2025
Total time taken to generate the page: 0.05832 seconds
|