[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gambas-bugtracker] Bug #3135: Problems with the printer class in qt6 on Manjiaro and GTK on Mint 22


http://gambaswiki.org/bugtracker/edit?object=BUG.3135&from=L21haW4-

Comment #3 by Benoît MINISINI:

OK, it's your code that is incorrect. If I fix it, everything works with QT6 and GTK+3.

Replace:

  Paint.DrawImage(hPage, 0, 0, fWidth, fHeight)

by:

  Paint.DrawImage(hPage, 0, 0, Paint.W, Paint.H)

The size of the page for the 'Paint' class is always 'Paint.W' and 'Paint.H'.

Your 'fWidth' and 'fHeight' are the size of the page in a different unit, that does not necessarily match the one used by the Paint class (which can be anything).

Actually they are pixels:

fWidth = Printer1.PaperWidth / 25.4 * Printer1.Resolution

=>

unit of 'fWidth' = unit of 'Printer1.PaperWidth' / (mm / inch) * unit of 'Printer1.Resolution'
                 = mm / (mm / inch) * (pixel / inch)
                 = mm / mm * inch * pixel / inch
                 = (mm / mm) * (inch / inch) * pixel
                 = pixel



----[ Gambas bugtracker-list is hosted by https://www.hostsharing.net ]----