Pasting image to rtf file

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi, Does anyone have an example of how to paste or inserting an image into a rtf file? I have tried the following but the image is represented as a lot of weird letters and numbers

FileOpen(1, "c:\temp\Document.rtf", OpenMode.Binary, OpenAccess.Write
FilePut(1, "c:\temp\on.gif"
FileClose(1

Hope that somebody has an exampl
Thanks
 
Hi,


If you put an rtf file in the richtextbox control this will work.
Dim img As Image = Image.FromFile("C:\camera.bmp")

Clipboard.SetDataObject(img)

RichTextBox1.Paste()



Ken

------------------

sneffe said:
Hi, Does anyone have an example of how to paste or inserting an image into
a rtf file? I have tried the following but the image is represented as a lot
of weird letters and numbers:
 
* "Ken Tucker said:
If you put an rtf file in the richtextbox control this will work.
Dim img As Image = Image.FromFile("C:\camera.bmp")

Clipboard.SetDataObject(img)

RichTextBox1.Paste()

That works, but it will remove an image from the clipboard if the user
has seleced another image before. I prefer to restore the clipboard
content after pasting the image.

;-)
 
Back
Top