Jump to content
perryhs

Window /client size bug in 10.4

Recommended Posts

I compiled and used a search program which used a background image (TImage) on a form in the community edition version 10.3. When I ran the program, the window autosized perfectly to the size of the image, which is what I wanted. I upgraded to 10.4 recently and made a small addition to a part of the code which did not affect the image or window size. When I recompiled the code and ran it, it opened a very large window (not maximized) of strange dimensions in which the form displayed in the upper left hand corner. The form filled one third of the window instead of the full size. If I were to guess, the x and y dimensions seemed to be reversed.

 

I thought that maybe my addition to the code affected something, so I tried compiling the original code from 10.3 in 10.4, but that also produced the same incorrect window size. Is there a bug in the 10.4 version?

Share this post


Link to post
7 hours ago, perryhs said:

Is there a bug in the 10.4 version?

Possibly.  Embarcadero has been playing around with High-DPI support for a few versions now, which can cause weird side effects.

Edited by Remy Lebeau

Share this post


Link to post

If you stored the image in the image control.  Try this in 10.4

  • Select Image in Design window.
  • Bring up the Picture editor F11 for object inspector and click on ellipses ...
  • In the Picture editor save image as some thing else plus extension what it was.( .bmp .ping)
  • view the image with other app.
  • Other wise just delete the image control and install fresh one.

Share this post


Link to post

Thanks for your suggestions. Although I could understand this if the difference in the version numbers was very great, or if the code was very, very old, but I don’t like the fact that there is such a discrepancy compiling code just between 10.3 and 10.4.

 

Anyway, I had to play around with the code base somewhat and found an easy workaround – I changed the ClientWidth and ClientHeight values on the Form1 until the program looked like it did before. I don’t know how the Delphi compiler figures this, but the difference was rather remarkable. The original width was 1920 and the height was 1080. I had to change these to 1500 and 860 respectively.

Share this post


Link to post
2 hours ago, Tom Chamberlain said:

Maybe something to do with Marco's blog post from January 3rd, here.

Actually Marco's post is between D11 to D10.4  PE flags updated to 6 to allow thinner borders and more margin.

 

21 hours ago, perryhs said:

window autosized perfectly to the size

Try Autosizing False and Center True.  To center image on form set align = alClient.   That allows changing images readily.   

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×