Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous messageGo to previous message
Oblivion is currently offline  Oblivion
Messages: 1093
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



 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to include files .h or .cpp as external library?
Next Topic: How I can load inside Utimate++ RayLib For MacOs And Win?
Goto Forum:
  


Current Time: Sat May 11 11:30:58 CEST 2024

Total time taken to generate the page: 0.03854 seconds