> 2010/11/9 Gregor Burck <[email protected]>:
> > 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 :)

Actually you can use the Draw.Scale() method so that you don't have to call 
mmToDots each time you draw something.

Draw.Scale(Draw.Resolution / 25.4, Draw.Resolution / 25.4)

Regards,

-- 
Benoît Minisini

------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
Gambas-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to