Rick_S
asked on
Converting RTF (Contents of RichEdit) to Bitmap
How can I convert the contents of RichEdit to a Bitmap in an efficient manner? The ideal situation would be to read a rich text file from memory and then convert to a Bitmap.
Though I haven't tried this, I imagine the easiest way would be to print the RTF to a TBitmap.Canvas manually using TextOut and manually setting the properties. I don't think there is a way to just designate the RTF Print Canvas short of rewriting your own TRichEdit based on the TcustomRichEdit and overriding the Print routine there to output to a TBitmap.Canvas instead of the Default PRinter DC (if you have the VCL Source, lookup TRichEdit.Print to see how they do it). I know it's an ugly solution but it is the only way I am aware of to do a bitmap from a RichEdit as the PainTo call does nothing more than display a bitmap of the control itself not the contents therofAndy
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That works good but maybe is wasn't very clear... I need to do this without the RichEdit component visable the example above didn't work when the 'RichEdit1.Visible := False' for obvious reasons.