I can’t get a simple answer to this.
I have pixel coordinates, I want to print an image in a (landscape) page at those coords.
In my printing event I do:
Dim mypoint As New PointF(1, 1192)
e.Graphics.DrawImage(My.Resources.littleSquare, mypoint)
This obviously doesn’t work: I specify pixels but the driver expects inches(?) or what?
Tried to: e.Graphics.PageUnit = GraphicsUnit.Inch with no luck.
I’d like a conversion method like:
Dim mypoint As New PointF(convertPixelsIntoInches(1), convertPixelsIntoInches(1192))
e.Graphics.DrawImage(My.Resources.littleSquare, mypoint)
Private Function convertPixelsIntoInches(ByVal pixels As Integer) As Single
Return ??
End Function
Any hints? Thanks.
I think I got it.
My pixel coordinates are not fixed, but relative to a 300dpi canvas, thus I have to do a double DPI conversion, like this: