Oleg

Oleg

  • NA
  • 8
  • 0

Text to image (regex and richtextbox)

Nov 3 2009 3:49 AM
Hi All. 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?

Answers (3)