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 #52692 is a reply to message #52685] |
Mon, 11 November 2019 22:02 |
fasasoftware
Messages: 15 Registered: July 2019 Location: Italy
|
Promising Member |
|
|
Dear Koldo,
i have tryed your suggestion idea...but without success...
i have try to follow that you tell me but i cant include my image in the exe or app...or better my mac give an error... i enclose here the list of code and the error screenshot...
Can you bemore prececise please???' Thanks a lot...Lestroso
#include <CtrlLib/CtrlLib.h>
#include "MyImage.brc"
using namespace Upp;
struct SplashScreen : TopWindow {
Image img;
void Paint(Draw& w) override
{
if(!IsNull(img)) w.DrawImage(0, 0, img);
}
SplashScreen()
{
img = StreamRaster::OpenAny(String(MyImage, MyImage_length));
CenterScreen().SetRect(img.GetSize());
}
};
GUI_APP_MAIN
{
SplashScreen().Run();
}
And also dear Oblivion,
i have had success after a lot of time that i'm trying to follow your code...this works fine for me:
but i have had to include in the pack manager :Core,CtrlCore,CtrlLib,Draw,Painter,PdfDraw,Richtext,plugin/ bmp,plugin/jpg,plugin/png.
#include <CtrlLib/CtrlLib.h>
using namespace Upp;
struct SplashScreen : TopWindow {
Image img;
void Paint(Draw& w) override
{
if(!IsNull(img)) w.DrawImage(0, 0, img);
}
SplashScreen()
{
img = StreamRaster::LoadFileAny("/Users/pippo/Desktop/SplashScreenFasa/FasaSplash.jpg");
CenterScreen().SetRect(img.GetSize());
}
};
GUI_APP_MAIN
{
SplashScreen().Run();
}
|
|
|
Goto Forum:
Current Time: Sat May 11 08:34:07 CEST 2024
Total time taken to generate the page: 0.02875 seconds
|