PDA

Click to See Complete Forum and Search --> : embedding images into rich text boxes


mattins
Apr 5th, 2000, 11:01 AM
i am wondering if there is a way to embed graphics or images of some sort into a rich text box. if not, is there a way to embed a graphic into an OLE object and place the OLE object into a rich text box. i am trying to create the happy faces like in America Online's Instant Messenger. ummm, maybe there is an API call besides bitblt to paint onto a window. if anyone can help, please email me at racobac@aol.com, or post a reply to this message. thank you very much.

RavenCrow
Apr 5th, 2000, 03:35 PM
Well seeing as a rich text box is not a container object (i.e. it can't contain other controls) you won't be able to place a ole object in it. Aol instant messanger most probably uses a custom control. As I haven't had much experience with the rich text object, there might be other methods that one could use to insert objects (Take word pad for instance, which is basically a .rtf editor where you can insert pictures.)

If you get the answer, let me know.

hozo
Aug 13th, 2002, 01:14 PM
I found a a$$-backwards way of doing it if you are interested.

basically i made a simple rtf -> text converter and c&p my graphics into the rtb... which generated the rtf code into my text box. I then took out the {\pic} header which is basically the image code itself. stored that into a library (.txt i made) with my own headers and call on that in the program.

you can use .selrtf to insert the code. it works

mercajay
Oct 2nd, 2002, 05:22 AM
please elaborate on the {\pic} header thing . i want to geta a image displayed in the rtf files

Shell
Oct 2nd, 2002, 06:38 AM
I know one way, but it uses the clipboard. This is it:


Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const WM_PASTE = &H302

Clipboard.Clear
Clipboard.SetData picture1.Picture

SendMessage RichTextBox1.hwnd, WM_PASTE, 0, 0


This pastes the picture from picture1 into the rich textbox.

-Shell-

mercajay
Oct 2nd, 2002, 06:49 AM
what will u do for inserting images in a rtf file using the file system object of asp and using the rtf script.