My app has a splash screen, but it was created at least 16 years ago (BCB5 I think) and I'm really ready for something else.
It's based on two BMP's. One is used as a mask to tell the code what should be transparent.
Instead of hurting my (currently covid impaired) head trying to figure out the old code and ancient methods of then, surely VCL Forms and graphic support has evolved to something where this is a lot easier to do ?
I recently upgraded to C++ Builder 11 (coming from Builder 2009)
I was thinking of finding a graphical artist who can make me a nice *.png that I then use as splash screen. It's far easier to ask someone to make a nice PNG than to describe the need for two BMPs, one of which acts purely as a mask etc.
I tried a few things with a free test.png found on the net (artist unknown), but I'm not having the easy success I hoped I'd have.
Are there good and easy ways to do this using Builder / Delphi 11 ?
I looked around but wasn't very successful in finding documentation. I see Anders has a couple blog posts about it, but that too seems outdated (correct me if I'm wrong).
The easy:
- I created a Windows VCL test app
- Set Form BorderStyle = bsNone
- Plonked a TImage on the form (Align = allClient)
- Loaded the test.png in Image1's Picture at design time
- Compiled. Works nicely but of course the form color shows where the PNG is transparent
- I then set the Form background to MoneyGreen, TransparentColor = true, TransparentColorValue = clMoneyGreen
- Compiled. Nice result but the PNG half transparent regions blend with the green color, and are hence not blending with the background.
- The net result is sadly not perfect. It was simply too easy 😉 I made this screenshot on a white background.
If I set AlphaBlend = true and give it an AlphaBlendValue = 100 (for instance) there are certainly very nice additional features to play with:
Now, this doesn't need to be total failure.
- I could experiment with different Form background colors and see how they interact with the half transparent fields of the PNG. Perhaps the net result is pleasing.
- I could ask the artist to make me a transparent PNG but with well defined edges that don't blend, that are not half transparent.
In conclusion, as far as super easy methods go, this certainly is not a bad start if a good color compromise can be found for the blending issues and/or depending on the PNG.
But ... perhaps I'm missing quite a few things that can be done to achieve a perfect result ?
Please let me know.
Thanks.
The test.png also attached: