Good! Here's a short explanation of the measurement systems and the conversion that was done. As mentioned image unit is Pixel, the resolution (HorizontalResolution, VerticalResolution) says how many pixels there is per inch, for display devices also called PPI (pixels per inch), so the relation between these give the inch measurement. Since the numbers in PageBounds/MarginBounds is in scale 1:100 we have to multiply the image sizes by 100 to get values in same scale.
DPI relates to PPI by 1:1 for display devices, a printer can have higher resolution and use multiple ink dots per pixel.
For example page width can be 827, which is 8.27in. An image of 400x400 at 150dpi/ppi is 2.67in. wide. The values that is compared in PrintPage handler here would be 827 and 267, and the X value of the point would be (827-267)/2=280.
|