I have a C # WinForms application that consists of a server and a client. I am using the TextRenderer.MeasureText(string text, Font font) method to measure text.
At some point, I need to measure the text on the server side, as if it were on the client. I send Graphics.DpiX and Graphics.DpiY values ββfrom client to server. Based on these values, how can I measure text on the server side? The key point is that the client and Dpi server may be different.
I think I can somehow create a Graphics object from the Dpi values ββand use the overload of TextRenderer.MeasureText(IDeviceContext dc, string text, Font font) to measure my text. But how to create Graphics only from the values ββof DpiX and DpiY?
c # text dpi winforms measure
Artem Kachanovskyi
source share