| Subject |
Re: Metric conversion |
| From |
Tom <IHaveNoEmail@ddress> |
| Date |
Sat, 25 Mar 2023 16:32:32 -0400 |
| Newsgroups |
dbase.getting-started |
On 3/25/23 3:57 PM, Richard wrote:
> But those factors depend on your form's ScaleFontName and
> ScaleFontSize
>
> On Sat, 25 Mar 2023 21:34:28 +0200, Mervyn Bick
> <invalid@invalid.invalid> wrote:
>
>> On 2023/03/25 18:27, Tom wrote:
>>> Hi all,
>>>
>>> Found lots of conversion formulas in the dUFLP but not the one I am
>>> looking for.
>>>
>>> I wish to convert form metric characters to form metric pixels.
>>>
>>> Seems like I saw this in some program in the dUFLP but, as usual, cannot
>>> remember where.
>>>
>>> Thanks in advance,
>>>
>>> Tom
>>
>> Set up a form with metric = 0 (Characters) with top = 10 , left = 10,
>> height = 10 and width = 100 and save it. Open the form in the designer
>> and change the metric to 6 (Pixels) and save. If you open the form in
>> the sourcecode editor you will see that
>>
>> height = 10.0
>> left = 10.0
>> top = 10.0
>> width = 100.0
>>
>> has been changed to
>>
>> height = 220.0
>> left = 70.0
>> top = 220.0
>> width = 700.0
>>
>>
>> The easiest way to convert a form's metric from character to pixels is
>> to open it in the designer, change the metric property from 0 to 6 and
>> save the form. dBASE will do all the conversions for you.
>>
>> If you have many forms to convert you could write a program to read a
>> form's source code line by line, parse each line and multiply height and
>> top properties by 22 and multiply left and width properties by 7 before
>> writing the line back to a new file.
>>
>> You will also need to check that the metric property is included in the
>> form's constructor code. It it is change it to 6, if it isn't (which is
>> quite likely if you haven't changed the metric property and then changed
>> it back to character) then add the line.
>>
>>
>> Mervyn.
>>
>>
>>
*
Better jump in here and say my conversion figures are based on Arial
10.0 being my default ScaleFontName and ScaleFontSize values (i.e. works
on my computer but maybe not yours)
Thank you Richard.
Tom
|
|