I expected the difference to be due to the printer resolution.
So I added the MaxResolution stuff to the code, and generated this:
[code] private sub PrintTest()
Dim g As Graphics
dim left, top as integer
dim strText as string
// Use Printer Settings
dim p as new PrinterSetup
p.MaxHorizontalResolution=-1
p.MaxVerticalResolution=-1
g = OpenPrinterDialog§
dim pic as new Picture(g.height, g.width,32)
// draw directly to the printer graphics object
g.AntiAlias = true
g.TextSize = 100
left = 71
top = 100
strText = “Hello World”
g.DrawString(strText, left, top)
// draw into a picture
pic.Graphics.AntiAlias = true
pic.Graphics.TextSize = 100
left = 71
top = 100
strText = “Hello World”
pic.Graphics.DrawString(strText, left, top)
// draw the image into the printers Graphics object
g.DrawPicture(pic, left, top + 300)
end sub[/code]
I run this and instead of printing, I ‘open PDF in Preview’ on my mac
At a max resolution of 300 dpi, the print quality of the letters is not the same, but its not bad
.
But at a text size of 11, there is still a world of difference.
It does seem that if you print text to the printer graphics, it understands that this is a vector font and retains the quality.
For even better evidence of this, use a font size of 4
It shouldnt be possible to show any detail in 4 points of height, yet if you zoom in to the result, the text printed straight to graphics is sharp as a pin, and the one in the picture is a blur
One technique to address this kind of thing is to assemble the page as vector objects.
Then draw the vector objects to either a picture (for screen display only) , or a printer (when printing)
That way you get the maximum resolution every time.