views:

345

answers:

2

I am attempting to create and store a jpeg image on the fly with dynamic rich text. The rich text is comes from user input into the cute editor for asp.net. This particular editor can output either xHTML or rtf and some others. I'm using GDI+ to open a default background jpeg and overlaying it with the rich text from cute. I haven't found any way to do this yet.

A: 

Use Graphics.DrawString()?

Gerrie Schenck
That will loose the formatting, and give you a plain string in the font of your choice
Pondidum
Yes, I cannot lose formatting, that is the point of using cute.
Cptcecil
A: 

One approach is to take the xHTML and render it server-side, then convert to an image. You could render the xHTML inside an HTML element that has the background set to your background image.

You can find more info on how to do that here:

http://stackoverflow.com/questions/969580/how-can-i-convert-a-dom-tree-into-an-image/969608#969608

Update: Direct link to source: http://www.tommyt.se/file.axd?file=Thumbnailer_src-0.2.zip

RedFilter
I'd like to use this as last resort because i don't want to have to purchase a new library at this time.
Cptcecil
You don't have to purchase anything, the source is right here: http://www.tommyt.se/file.axd?file=Thumbnailer_src-0.2.zip
RedFilter