This won't be easy to do though the math is simple and implemented in the Matrix class. all factors come in like screenresolution etc. the Graphics where your picture resides (at least my pictures do) has a Matrix called Transform which does the final transformation for your picture, you can tweak a Matrix scaling thus that its fits your pixel to mm conversion and tranform the points you need to convert through this matrix and set your Graphics variables Transform (which seems to be set/read-only) to this Matrix to show your picture. But note: the matrix will (I think) be different on systems which uses other resolution.
Hope this non-solution helps, though mm and pixel seem members of the same enumeration the .Net framework doesn't seem to have converters between them. I don't know whether it is possible for the PTB's to factor in all the factors that come in into this conversion. |