> I've tried to do exactly what I've done in G2: giving coordinates in
> original pixel sizes of the image.
> Can I set the resolution to 300 dpi and to use the originally measured
> horizontal and vertical pixel coordinates for printing? You know the
> program I'm working on is right about the using mouse coordinates for
> positioning the text, to avoid the unnecessary measurement
> coordinate's transformation. But as it seems to me, G3 is about how to
> make simple things complicated :(
> 
> Thanks anyway, I'll try to fix it.
> 
> Csaba
> 

There are three reasons for the new Printer API in Gambas 3 :

- The Qt drawing model has changed.
- GTK+ got a printer API that uses Cairo.
- The Gambas 2 Printer API was blocking the GUI.

So it is a bit more complicated now, as you have to use events, and the new 
Paint class that mimics the Cairo API.

Otherwise, there is no "unnecessary coordinate transformation". If you using 
screen coordinates for printing in Gambas 2 worked, then it just means that 
you were lucky. 

Because doing that is as false in Gambas 2 as it is in Gambas 3.

In other words, you have to do coordinate transformation.

To do that, for example, you draw inside the (0, 0, Printer.PaperWidth, 
Printer.PaperHeight) rectangle, each unit being a millimeter. And before 
calling the Paint method, you scale the rectangle to (0, 0, Draw.Width, 
Draw.Height).

To do this scaling, you have the "Paint matrix", i.e. the Paint.Scale() 
method.

I will try to add these explanations to the wiki.

Regards,

-- 
Benoît Minisini

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to