This question is somewhat related to, or at least caused by, my previous question. To create that gauge the way I want it, ViSi is generating 5001 images (plus the other images in my project) creating a 391MB .gci file, which I load onto the uSD card. Near the beginning of my main() I call:
This call takes a significant amount of time to return while it's going through that huge .gci file. I'd like to see if I can display a splashscreen prior to that call so that it at least looks like the LCD is on and working. I looked into the file_Image(x, y, handle) function and tried the following in main():
This doesn't seem to work. All I get is a blank white screen prior to parsing the Test.gci files. I verified that splashHandle is non-zero (it's 4704), but I don't see the image on screen.
As a complete hack, I did the following, which works, but I'd like to know the right way to do what I'm doing above. The hack:
I created a separate Workshop ViSi project called “Splashscreen” that consists of a single white screen with the "Image.png" centered. Then I compiled that project to have Workshop 4 generate the “SPLASH~1.dat” and “SPLASH~1.gci” (only 79kb) files and copied those over to the uSD card. Then in back my "Test" project code I make the following calls:
This does what I want it to, but seems like the wrong way to go about it, since I'm creating a second project just to generate the .dat & .gci files I need for my splashscreen
Code:
hndl := file_LoadImageControl("Test.dat", "Test.gci", 1);
Code:
if (!(file_Mount())) while(!(file_Mount())) putstr("Drive not mounted..."); pause(200); gfx_Cls(); pause(200); wend endif gfx_TransparentColour(0x0020); // uncomment if transparency required gfx_Transparency(ON); // uncomment if transparency required gfx_Set(SCREEN_MODE,LANDSCAPE); var splashHandle; gfx_BGcolour(WHITE); gfx_Cls(); splashHandle := file_Open("Image.png",'r'); if(splashHandle != 0) file_Image(60, 20, splashHandle); // show splashscreen image file_Close(splashHandle); endif hndl := file_LoadImageControl("Test.dat", "Test.gci", 1);
As a complete hack, I did the following, which works, but I'd like to know the right way to do what I'm doing above. The hack:
I created a separate Workshop ViSi project called “Splashscreen” that consists of a single white screen with the "Image.png" centered. Then I compiled that project to have Workshop 4 generate the “SPLASH~1.dat” and “SPLASH~1.gci” (only 79kb) files and copied those over to the uSD card. Then in back my "Test" project code I make the following calls:
Code:
gfx_Set(SCREEN_MODE,LANDSCAPE); var splashHandle; gfx_BGcolour(WHITE); gfx_Cls(); splashHandle := file_LoadImageControl("SPLASH~1.dat", "SPLASH~1.gci", 1); // load the images from the “Splashscreen” project img_Show(splashHandle, 0); // show the "Image.png" image hndl := file_LoadImageControl("Test.dat", "Test.gci", 1); // now make the time-consuming call
Comment