Text to image

regex and richtextbox

Page 1 of 1

1 Replies - 690 Views - Last Post: 03 November 2009 - 03:28 AM Rate Topic: -----

#1 Solmyr  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 03-November 09

Text to image

Posted 03 November 2009 - 01:48 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?

Is This A Good Question/Topic? 0
  • +

Replies To: Text to image

#2 Solmyr  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 03-November 09

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 :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1