John wrote:
Anyone know of a component like TRichEdit but which allows the
insertion of images as well as text. Something which behaves like
Microsofts's wordpad ?.
TRichEdit actually supports the insertion of bitmaps. The catch is that
it is a very complex operation to perform manually, involving the InsertObject()
method of the IRichEditOle interface, which in turn requires the use of IOleObject,
IStorage, and IOleClientSite interfaces. Microsoft has an article on MSDN
explaining how to do it:
How to insert a bitmap into an RTF document using the RichEdit control in Visual C++ 6.0
https://support.microsoft.com/en-us/kb/220844
Robert Dunn wrote some wrapper clases for C++Builder that handle
the complexity for you. Sadly, his site went offline several years ago,
but there is an archive of it available on my site:
https://community.embarcadero.com/forum/ui/1823-robert-dunn-s-yacs-site-lives
http://yacs.lebeausoftware.org
In particular:
Add OLE functionality to TRichEdit (TRichEditOle & TRichEditOleCallback classes)
Want to insert a bitmap into a TRichEdit component? Here is some code you
can use that adds bitmap support and more.
http://yacs.lebeausoftware.org/CodeSamples/RichEditOle.zip
--
Remy Lebeau (TeamB)
Connect with Us