 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Anthoni Gardner Guest
|
Posted: Mon Sep 06, 2004 7:45 pm Post subject: Delphi Measurements, what are they? |
|
|
Hello,
I am wanting to display 'adverts' in my new program (for the free version)
and I have selected where they should be placed in my gui. The adverts all
need to be the same size, however I am finding it hard to convert Delphi's
measurements (such as Width, Height, etc) into true Pixel sizes that
Photoshop (or any other popular paint program) uses.
Any one come across this before?
For Example, my 'advert space' width in Delphi is 140, but this is not in
pixels because when I create an image of this width it doesnt fit properly.
Any help and guidance on this would be appreciated.
Regards
Anthoni
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system ([url]http://www.grisoft.com)[/url].
Version: 6.0.745 / Virus Database: 497 - Release Date: 27/08/2004
|
|
| Back to top |
|
 |
Camiel Wijffels Guest
|
Posted: Mon Sep 06, 2004 7:57 pm Post subject: Re: Delphi Measurements, what are they? |
|
|
| Quote: | For Example, my 'advert space' width in Delphi is 140, but this is not in
pixels because when I create an image of this width it doesnt fit
properly.
Anthoni
|
The width and height of the components and forms which Delphi reports is
always in pixels. However your advert space might have a border or a bevel?
Then the space is less ie 136 or 134 pixels.
Furthermore in Photoshop one often works with DPI, which differs from
pixels. If your image is 140 DPI (dots per inch), then the image may only by
*one* inch wide. Cause if the image is fr example two inches wide then the
number of dots (or pixels) is suddenly 280.
--
Best regards, Camiel Wijffels
|
|
| Back to top |
|
 |
Jacques Oberto Guest
|
Posted: Mon Sep 06, 2004 8:54 pm Post subject: Re: Delphi Measurements, what are they? |
|
|
| Quote: | The width and height of the components and forms which Delphi reports is
always in pixels. However your advert space might have a border or a
bevel?
Then the space is less ie 136 or 134 pixels.
Furthermore in Photoshop one often works with DPI, which differs from
pixels. If your image is 140 DPI (dots per inch), then the image may only
by
*one* inch wide. Cause if the image is fr example two inches wide then the
number of dots (or pixels) is suddenly 280.
--
Best regards, Camiel Wijffels
|
I think it would be easier to keep always the same aspect ratio for every
advert and
then do a stretchdraw.
Jacques
|
|
| Back to top |
|
 |
Anthoni Gardner Guest
|
Posted: Mon Sep 06, 2004 9:34 pm Post subject: Re: Delphi Measurements, what are they? |
|
|
Hi Jacques,
| Quote: | I think it would be easier to keep always the same aspect ratio for every
advert and then do a stretchdraw.
|
All the adverts will have the same dimensions so this is not a problem.
However, I dont understand what stretchdraw is.
Can you elaborate please?
Regards
Anthoni
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system ([url]http://www.grisoft.com)[/url].
Version: 6.0.745 / Virus Database: 497 - Release Date: 27/08/2004
|
|
| Back to top |
|
 |
Jens Gruschel Guest
|
Posted: Mon Sep 06, 2004 10:05 pm Post subject: Re: Delphi Measurements, what are they? |
|
|
| Quote: | however I am finding it hard to convert Delphi's
measurements (such as Width, Height, etc) into true Pixel sizes that
Photoshop (or any other popular paint program) uses.
|
Delphi uses pixel sizes. What might confuse you is ClientWidth /
ClientHeight (without border) vs. Width / Height (with border). So if you
set a form's Width and Height to some value, there is less space to draw to
(the same is true for other containers with a border). So always set
ClientWidth and ClientHeight, if you need a specific size for your drawings.
Another topic you have to take care of: Delphi is able to resize a form if
the screens DPI resolution differs (e.g. large fonts are enabled on the
system), so set the Scaled property of your form to False, if you don't need
it to be scaled (what's quite useful if labels, edit boxes or other text is
used, which might be larger depending on the user settings).
Jens
|
|
| Back to top |
|
 |
Nils Haeck Guest
|
Posted: Tue Sep 07, 2004 12:20 pm Post subject: Re: Delphi Measurements, what are they? |
|
|
"Anthoni Gardner" wrote in message news:413cd7c6 (AT) newsgroups (DOT) borland.com...
| Quote: | However, I dont understand what stretchdraw is.
Can you elaborate please?
Regards
Anthoni
|
See TCanvas.Stretchdraw in the Delphi help...
Nils
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|