c# - TextRenderer: How to measure text as if it was on machine with different Dpi? -
i have c# winforms application consists of server , client side. use textrenderer.measuretext(string text, font font)
method measure text.
at moment need measure text on server side, if on client. send graphics.dpix , graphics.dpiy values client server. based on values, how can measure text on server side? key point client , server dpi might different.
i guess, can create graphics
object dpi values somehow , use textrenderer.measuretext(idevicecontext dc, string text, font font)
overload measure text. how create graphics
dpix , dpiy values?
you can try hack: apply transform font size you're using measure: drawing 12pt font on 120dpi take same number of pixels drawing 12*120/96=15 on 96 dpi.
Comments
Post a Comment