Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


_ Wrong proportionality

Posted on 1999-06-27
Medium Priority
Last Modified: 2010-04-06
Why my program ran on a "small size" font and ran on a "large font" are different.

I set the property PrintScale to "poProportional" but when my program is ran on another scale, the words and the images are not correctly drawn.

How can I prevent this?

Question by:Wein
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3

Accepted Solution

wkhays earned 280 total points
ID: 1384841
This is a common problem.

You have to scale the design-time resolution of the form to the ration of the resolution of the run-time / design-time screen resolution.  I know that doesn't sense, but just do this in the TfForm1.FormCreate() event:

   fForm1.PixelsPerInch := Screen.PixelsPerInch;

From the help file:

Use PixelsPerInch at runtime to change how the form is scaled to the current screen resolution. If PixelsPerInch is changed from its default value, the form will not have the same proportion on every screen resolution.

At design time, PixelsPerInch is set automatically when the form is saved. Changes to PixelsPerInch in the Object Inspector are seen at runtime only.

The form’s Scaled property must be True for PixelsPerInch to have any effect.

Good luck!

Expert Comment

ID: 1384842
There are also some good shareware components that claim to address the problem more rigorously than the out-of-the box Delphi resolution approach I outlined above... I think one is called TSizer (Shareware, not Freeware).


Author Comment

ID: 1384843
yeah, but if i have an image, will it be shifted or wrongfully displayed
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.


Expert Comment

ID: 1384844
I use bitmaps on applications at work on various screen resolutions, and this is all I do to keep things straight!

Author Comment

ID: 1384845
Have you ever tried to remove that line?

What have happened to your form?

Author Comment

ID: 1384846
Yeah it works perfectly.

But in a form whose MinMaxInfo was set, the form is a little bit different.

I can use If conditions like the fallowing lines to solve the problem but do you have any better suggestion?

If Screen.PixelsPerInch = 96 then ...
If ...... = ...



Author Comment

ID: 1384847
Adjusted points to 75

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : All lightning effects with instructions : http://www.mediaf…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

660 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question