I am battling Windows to get the resolution of the printer.
On Mac, after PrinterSetupDialog, if I set MaxHorizontalResolution = -1 and the same for maxVerticalResolution, then HorizontalResolution and VerticalResolution reflect the maximum resolution of the printer.
On Windows, HorizontalResolution and VerticalResolution desperately stay at 72 dpi.
I thought about getting g.width and g.Height at the time of printing, but what I get is 600 dpi for a printer that is reporting 300 on Mac.
If I set MaxHorizontalResolution and maxVerticalResolution at 300, no error but still, HorizontalResolution and VerticalResolution desperately stay at 72 dpi.
Is there any way to get the actual resolution of the printer under Windows ?
Well, do you know. I drew bars every 300 dpi. They are spaced half an inch apart. So using g.Width works, and my printer is indeed 600 dpi, not 300 as Mac reports
The Horizontal/Vertical resolution values are set after you open the printer. At least on Windows, Mac may act differently. I’ve never seen the values be wrong (after opening the printer).
In Xojo 2016 R3, you could use and get the resolution with:
Dim g As graphics
Dim ps As PrinterSetup
ps = New printerSetup
ps.MaxHorizontalResolution = -1 '-1 to use max resolution
ps.MaxVerticalResolution = -1
If ps.pageSetupDialog Then
g = OpenPrinterDialog(ps)
If g <> Nil Then
'Get Printer resolution with g.Width, g.Height
End If
End If
2016 r4 broke printing and 2017 now allways will return 96.