If I calculate size in terms of width for text using below it give me says 500
intWidth = (int)objGraphics.MeasureString(String.concat(sImageText1, sImageText2), objFont).Width;
but if i do like this
intWidth = (int)objGraphics.MeasureString(sImageText1, objFont).Width + (int)objGraphics.MeasureString(sImageText2, objFont).Width;
I search lot and have done lots of different scenarios but still getting difference if we measure string width using “MeasureString” with full text or part by part.
Why is this?
The documentation has the answer:
The emphasized parts are what is relevant here.
To fix your code, add the necessary parameters: