I'm writing a little console application to convert text to image and faced with a problem:
My solution gets text as parameter, then formats text in the richtexbox and draws it in the Graphics element.
And I need to use simple tags such as <b>, <i>, <f=...> etc.
The problem appears when I'm trying to use Regex.Replace method on the formatted richtextbox text. This method removes all
formatting and sets font to the default. I'm newbe in C# and don't see any solution except read text character by character, store indexes
of substrings which have to be formatted, remove tags from text by editing string and format text by stored indexes.
But maybe there is a normal way, to do it via Regexes?
Text to image
Page 1 of 1
regex and richtextbox
1 Replies - 943 Views - Last Post: 03 November 2009 - 03:28 AM
Replies To: Text to image
Re: Text to image
Posted 03 November 2009 - 03:28 AM
I found simple solution, just remove tags when drowing image, because anyway when I'm drowing image I'm reading text char by char. But, the problem doesn't disappear, we can't use regex with formatted text. Or I don't know how
Page 1 of 1