473,651 Members | 2,644 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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\Docume nt.rtf", OpenMode.Binary , OpenAccess.Writ e
FilePut(1, "c:\temp\on.gif "
FileClose(1

Hope that somebody has an exampl
Thanks
Nov 20 '05 #1
3 4139
Hi,
If you put an rtf file in the richtextbox control this will work.
Dim img As Image = Image.FromFile( "C:\camera.bmp" )

Clipboard.SetDa taObject(img)

RichTextBox1.Pa ste()

Ken

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

"sneffe" <an*******@disc ussions.microso ft.com> wrote in message
news:F6******** *************** ***********@mic rosoft.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\Docume nt.rtf", OpenMode.Binary , OpenAccess.Writ e)
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***@bellsout h.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.SetDa taObject(img)

RichTextBox1.Pa ste()


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
2485
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 clipboard it's content type is image/x-java-image and when I try to paste it in some Mac application (for example MS Worf for Mac OS) it doesn't work. I think that this happens, because Word doens't understand the image/x-java-image content type....
1
2290
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 paintbrush doesn't show the image at the same quality it was copy from. I just need to make images files that has some clip arts, and filling colors effects. Also I am looking for good web graphic designing tool, please.
6
3438
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 there an easy way to save the clipboard contents and then restore it? Thanks
13
2930
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 cross posted there. The test case below is taken from an Imake setup (yes, old, I know). There's a Concat() macro which uses old-style /**/ for token pasting (we are not allowed to assume ANSI so ## isn't allowed). I'm trying to paste AND expand...
1
9012
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 graph area to the clip board (easy enough using Me.OleGraphControl.ChartArea.Copy). Next open an instance of MS Paint, paste the clipboard into the file and save as something like "Picture.bmp" in the same directory as the FE Access app. A...
5
6857
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" widget in Tkinter? Here is my first attempt with just trying to print out the image data: ----------------- def pasteImg(tgt): global clipboardEnabled if not clipboardEnabled: return
3
4610
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 artical http://www.thescripts.com/forum/thread356836.html but hasnt workfor me Const CF_ENHMETAFILE As Integer = 14 Dim henmetafile As IntPtr Dim metaFile As...
2
5727
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() { int x = 5; DEBUG("variable x is %d",x); }
0
10751
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 inside an image, hide your complete image as text ,search for a particular image inside a directory, minimize the size of the image. However this is not a new concept, there is a concept called Steganography which enables to conceal your secret...
0
8795
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8695
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8576
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7296
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6157
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4143
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2696
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1906
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1585
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.