Results 1 to 6 of 6

Thread: embedding images into rich text boxes

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2000
    Posts
    1
    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 [email protected], or post a reply to this message. thank you very much.

  2. #2
    Junior Member
    Join Date
    Sep 1999
    Location
    Kempton Park, Guateng, South Africa
    Posts
    24
    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.

    "He who laughs at a question is not worth being asked"

    RavenCrow

  3. #3
    Lively Member
    Join Date
    May 1999
    Location
    flanders, nj 07836
    Posts
    110
    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

  4. #4
    New Member
    Join Date
    Oct 2002
    Posts
    4
    please elaborate on the {\pic} header thing . i want to geta a image displayed in the rtf files

  5. #5
    Addicted Member
    Join Date
    Jun 2002
    Location
    Far.. far away! (Netherlands)
    Posts
    169
    I know one way, but it uses the clipboard. This is it:

    Code:
    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-

  6. #6
    New Member
    Join Date
    Oct 2002
    Posts
    4
    what will u do for inserting images in a rtf file using the file system object of asp and using the rtf script.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width