Drawing Rich Text String to Picture

How can I draw an imported Rich Text String to a canvas picture so that all of the formattings gets drawn to the canvas? Think of a Microsoft Word document that would have some words bold, some italic, so red font, some underlined font and so on.
There is a specific reason I have to use draw an image to a Cavans with the formatted text, so I any help with this will be appreciated.

Last time I tried, you could use an offscreen styled textarea to render RTF by setting myTextArea.StyledText.RTFData=theRTF Then “print” it to a graphics object using myTextArea.StyledTextPrinter(g,width).DrawBlock(x,y,height)


StyledText.RTFData doesn’t support everything, but it does a pretty good job.

I have found the best way is to iterate thru the styleruns, and using the inforation in each on, set the graphics object properties (font, color, bold etc), and use DrawString…

That works too, and gives you more control of the final output.

Are there any examples of what the iteration would look like?


Example in the StyleRun page…