Recent

Author Topic: Splash form "in pieces"  (Read 5011 times)

dietmar

  • Full Member
  • ***
  • Posts: 170
Re: Splash form "in pieces"
« Reply #15 on: September 24, 2021, 07:24:19 pm »
I already tried that, but without success.

I think I give up now :(

Dietmar
Lazarus 2.2.0RC1 with FPC 3.2.2 (32 Bit) on Windows10 (64Bit)

wp

  • Hero Member
  • *****
  • Posts: 8895
Re: Splash form "in pieces"
« Reply #16 on: September 25, 2021, 12:22:50 am »
This is an issue related to the different screen resolution on both systems.

When I open your demo on my standard development system at 96pp everything is nicely centered. When I open it on a VM at 144ppi the form is centered too, but larger. you have an image background in the splash form which you use as a mask to get some kind of oval window. Of course, this does not scale. Since the image is in the upper left corner of the window the masked window is no longer centered. And the progressbar does no longer overlap with the image.

In order to center the splash form on the high-res screen you either provide several background images depending on the actual resolutions so that they fill the window in the same way as they do at 96ppi. Or you set the TImage properties Stretch and Proportional to true to scale the image into the window.

This way I was able to center the window at 144ppi. The progressbar is still off. This is due to your function MakeTransparentWindow which seems not to be compatibile with LCL scaling. When I comment out its call the the progressbar is inside the window at runtim, however at a different position. But you reposition the progressbar in the OnCreate event, and I did not check this.

So, in summary:
Set Image.Stretched = true and Image.Proportional = true. Look into the MakeTransparentWindow to find where it collides with LCLScaling.

The easiest way, however, is to leave everything as it is now, but set the splash form's Scaled to false -- this disables LCLScaling for the splash form. The disadvantage is that the splash form appears to be smaller on a high res screen, and the progressbar appears to be thinner - but you can increase its height accordingly: pbInit.Height := Scale96ToForm(pbInit.Height) in FormOnCreate.
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

dietmar

  • Full Member
  • ***
  • Posts: 170
Re: Splash form "in pieces"
« Reply #17 on: September 25, 2021, 06:23:35 pm »
WP, you are not only "a" hero member, but MY personal hero member!!

Now it finally works and I am very glad!
I just made the Splash image bigger and did as you wrote in your last paragraph...

Thanks a lot, also to all the others contributing here! Great work!

--Diet"made my weekend"mar ;)
Lazarus 2.2.0RC1 with FPC 3.2.2 (32 Bit) on Windows10 (64Bit)

 

TinyPortal © 2005-2018