开发者

Use more than one font to drawstring

开发者 https://www.devze.com 2022-12-18 04:47 出处:网络
I want to use drawString to print a sentance but some parts of it has to be bold. What is the best way to do this? Yes, I have considered using two drawString. But is there a intelligent way of using

I want to use drawString to print a sentance but some parts of it has to be bold. What is the best way to do this? Yes, I have considered using two drawString. But is there a intelligent way of using 开发者_Python百科two drawStrings if we have to.

We cannot make any assumtion about the length of the sentance. However it is prepared in a format.

eg:

Say hello to name. Good afternoon name.

Thanks


This is my old question on MSDN & it was answered. It works good. I hope it is the thing you want to find. http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/8a050039-d74a-4ab5-9237-98615e10e303


Yes, you will have to call DrawString twice - you can write a small wrapper class (or extension method) that will do that for you.

0

精彩评论

暂无评论...
验证码 换一张
取 消