473,407 Members | 2,629 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Pasting image to rtf file

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
Nov 20 '05 #1
3 4114
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" <an*******@discussions.microsoft.com> wrote in message
news:F6**********************************@microsof t.com...
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 example
Thanks

Nov 20 '05 #2
Thanks Ken, just what i needed.
Nov 20 '05 #3
* "Ken Tucker [MVP]" <vb***@bellsouth.net> scripsit:
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.

;-)

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Vlado | last post by:
Hello, I need to copy/paste image from Java application to/from the System clipboard. On windows everything is just fine, but on Mac OS is not. The problem is that when I transfer image to the...
1
by: Mr. x | last post by:
Hello, I am looking for good image editor for web developing. I use the microsoft word, to do some clip-arts, and fill color effects, copy and paste the image to paint-brush, and I see that...
6
by: Just Me | last post by:
I've seen code that copies a bmp file into a RichTextBox by first putting it into the clipboard and then using Paste to get it into the RichtextBox. This destroys the clipboard contents. Is...
13
by: Henry Townsend | last post by:
I hope this is on-topic in c.l.c - it's about the C preprocessor more than the language per se, more generally about the K&R behavior, and most specifically about the Sun cpp which is why I've...
1
by: Tim Marshall | last post by:
In my not too successful attempts to get an OLE chart object (Graph 11.0) that has been manipulated on a form to be reproduced on a report, I am considering the following procedure. First copy the...
5
by: exhuma.twn | last post by:
As many might know, windows allows to copy an image into the clipboard by pressing the "Print Screen" button on the keyboard. Is it possible to paste such an image from the clipboard into a "Text"...
3
by: atif283 | last post by:
Hi I m worki on clip board m trying to copy RTF data(Text+Image) both txt and image on clip board its only pasting text On Excel not the image can any one help me in this regard I m using your...
2
by: mark.bergman | last post by:
I am porting some old code from Digital Unix to Linux using token pasting, which is failing to compile (code simplified): #define DEBUG(strg,v) printf("debugoutput: "##strg##".\n", v); main()...
0
Debadatta Mishra
by: Debadatta Mishra | last post by:
Introduction In this article I will provide you an approach to manipulate an image file. This article gives you an insight into some tricks in java so that you can conceal sensitive information...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.