Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Looking for a component like TRichEdit but whcih accepts bitmaps



Permlink Replies: 5 - Last Post: Jan 18, 2017 2:06 AM Last Post By: John Pearson
John Pearson

Posts: 42
Registered: 8/23/05
Looking for a component like TRichEdit but whcih accepts bitmaps
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 9, 2016 5:29 AM
Folks

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 ?.

John
Asger Joergensen

Posts: 370
Registered: 11/18/08
Re: Looking for a component like TRichEdit but whcih accepts bitmaps
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 9, 2016 6:18 AM   in response to: John Pearson in response to: John Pearson
Hi John

John Pearson wrote:

Folks

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 ?.

I think it is possible to insert pictures into the RichEdit control:

http://stackoverflow.com/questions/15318636/how-to-insert-picture-into-trichedit-in-delphi

here MickeySoft talks about it:
https://blogs.msdn.microsoft.com/murrays/2012/05/25/richedit-8-0-image-support/

never tried it though.

Best regards
Asger
John Pearson

Posts: 42
Registered: 8/23/05
Re: Looking for a component like TRichEdit but whcih accepts bitmaps
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 9, 2016 8:39 AM   in response to: Asger Joergensen in response to: Asger Joergensen
"Asger Joergensen" <Junk@Asger-P.dk> wrote in message
news:900215 at forums dot embarcadero dot com...
Hi John
I think it is possible to insert pictures into the RichEdit control:
http://stackoverflow.com/questions/15318636/how-to-insert-picture-into-trichedit-in-delphi
here MickeySoft talks about it:
https://blogs.msdn.microsoft.com/murrays/2012/05/25/richedit-8-0-image-support/

never tried it though.

Best regards
Asger

Asger,

I saw the 1st link, not the 2nd. I'm hoping not to have to try it myself -
but might have to !
Also there are wordpad-like editors on sourceforge, but only iNote has
source.
A licence free component is the ideal . . .

Best, John.
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Looking for a component like TRichEdit but whcih accepts bitmaps
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 9, 2016 10:27 AM   in response to: Asger Joergensen in response to: Asger Joergensen
Asger wrote:


EM_INSERTIMAGE !!!! Too bad it is Windows 8+ only.

--
Remy Lebeau (TeamB)
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Looking for a component like TRichEdit but whcih accepts bitmaps
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 9, 2016 10:19 AM   in response to: John Pearson in response to: John Pearson
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)
John Pearson

Posts: 42
Registered: 8/23/05
Re: Looking for a component like TRichEdit but whcih accepts bitmaps [Edit]
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 18, 2017 2:06 AM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Remy/Asger

Thanx for the help with OLEs in TRichEdit and to Remy for hosting Richard
Dunn's code.
It works out of the box but printing doesn't. Despite the posts at
http://stackoverflow.com/questions/38904160/why-is-tprinter-xe7-suddenly-having-problems-today
https://forums.embarcadero.com/thread.jspa?threadID=228998
I coudn't print with TPrinter. BTW I'm running XE2 on Vista

Anyway I'm satisfied as I found a simple
RichEdit1->Print(Caption) ;
prints.

Best John


"Remy Lebeau (TeamB)" <no dot spam at no dot spam dot com> wrote in message
news:900247 at forums dot embarcadero dot com...

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)
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02