[Gambas-user] Print, Resolution, Units

Fabien Bodard gambas.fr at ...626...
Tue Nov 9 17:57:29 CET 2010


2010/11/9 Doriano Blengino <doriano.blengino at ...1909...>:
> Fabien Bodard ha scritto:
>> 2010/11/9 Gregor Burck <gregor at ...2441...>:
>>
>>> Hi,
>>>
>>> when I want to print the units for draw were dots, for the gui I want to use milimeter.
>>> So I create a function
>>>
>>> public function mmToDots(mm as integer, resolution as integer) as integer
>>>  return Round(mm / 25.4 * resolution)
>>> end
>>>
>>> And draw e.g. a line with
>>> draw(mmToDots(X,draw.resolution),mmToDots(Y,draw.resolution),mmToDots(X2,draw.resolution)
>>> ,mmToDots(Y2,draw.resolution))
>>>
>>> to be independent from the Printer Resolution.
>>>
>>> But is there a better way for use the metric system to print?
>>>
>>>
>> the answer is no :)
>>
>>
> You could use Draw.Scale() to change world coordinates to mm...

yes :) ... if you use only one convertion type !



-- 
Fabien Bodard




More information about the User mailing list