[Gambas-user] Please help me!
Benoît Minisini
gambas at ...1...
Sun Jul 3 15:20:55 CEST 2011
> 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
More information about the User
mailing list