Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1106941
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T01:51:56+00:00 2026-05-17T01:51:56+00:00

I have a Delphi form with TImages on it. Actually, it’s a fake desktop

  • 0

I have a Delphi form with TImages on it. Actually, it’s a “fake” desktop with “icons” (the TImages).

When the user resizes the form (scales it or maximizes it, for example) the icons on the form should align proportionally.

Right now, I’m doing something like this with the images:

ImageX.Left:=Round(ImageX.Left * (Width / OldWidth));
ImageX.Top:=Round(ImageX.Top * (Height / OldHeight));

Now this is OK, as long as I start to make the maximized form smaller.

In that case the rightmost images are cut in part by the form’s border (they’re off the form’s client area).

If I reposition these images to fit the client area, then the position of the icons get distorted upon scaling back to maximum size.

Any ideas for a better algorithm/fix?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T01:51:57+00:00Added an answer on May 17, 2026 at 1:51 am

    First of all, you can’t have a correctly scaled desktop when you only move the images, and don’t scale them as well. You can do slightly better by moving the midpoints of your images, not their top left corner. It still won’t be perfect, but it will work better. Of course, now the images will be cropped on all four sides, not just bottom and right, but at least it will be symmetrical 🙂

    Second, you will get accumulative rounding errors since you constantly override the “original” values (ImageX’s top and left coordinate). You’d be better off having the original values stored in some sort of collection or array, and setting the new position based on the original value, rather than the previous value.

    Something like this:

    ImageX.Left:=Round(ImageX_OriginalLeft * (Width / Original_Width));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a delphi 7 form: and my code: when I run this form
I have a Delphi application that has a document browser as the main form.
I have a Delphi form with a bunch of VCL controls, like TButton and
I am trying to put form into help mode in Delphi 2010. I have
I have written an application (using Delphi 2009) that allows a user to select
I have a Delphi form with some DB controls on it. To represent a
I have a Delphi project and the main form is a child window of
I have a Delphi DLL that houses a form which uses a variety of
I have a TPanel on a delphi form, I want to copy all the
I have a Delphi form inside a DLL (I know that this restricts the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.