How to adjust size of programatically created Bitmap to match text drawn on it?

白昼怎懂夜的黑 提交于 2019-12-08 21:50:27
Will Marcouiller

I would guess there's a System.Drawing.Graphics.MeasureString method which will return the size of the specified text using the specified font.

Then, you may resize your image accordingly, or resize your text accordingly in order to make them both fit together.

Perhaps an eye out to this question and answers will guide you somehow, as the question is about sizing text so that it may fit within an area. You seem to wish to make something alike, so the algorithm may inspire you.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!