473,396 Members | 2,013 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,396 software developers and data experts.

Embedding an image in an RTF control

I'm trying to embed an image in an RTF control, but the only working method
I can find is to do so via the clipboard and use myRTF.paste().
The problem here is that it obviously destroys the existing clipboard
contents.
Does anyone know if there is a way to call the RTF control directly (such
as via API calls) and pass it the object to be inserted, or does anyone
have any other suggestions?

Cheers,
Jason
Nov 20 '05 #1
4 7414
Hello,

"Jason Sobell" <iG******@hotmail.com> schrieb:
I'm trying to embed an image in an RTF control, but the only working method I can find is to do so via the clipboard and use myRTF.paste().
The problem here is that it obviously destroys the existing clipboard
contents.
Does anyone know if there is a way to call the RTF control directly (such
as via API calls) and pass it the object to be inserted, or does anyone
have any other suggestions?


You can try to save the clipboard content, then insert the image and restore
the clipboard content.

Regards,
Herfried K. Wagner
--
MVP · VB Classic, VB .NET
http://www.mvps.org/dotnet
Nov 20 '05 #2
On Sun, 31 Aug 2003 12:54:39 +0200, Herfried K. Wagner [MVP] wrote:
Hello,

"Jason Sobell" <iG******@hotmail.com> schrieb:
I'm trying to embed an image in an RTF control, but the only working

method
I can find is to do so via the clipboard and use myRTF.paste().
The problem here is that it obviously destroys the existing clipboard
contents.
Does anyone know if there is a way to call the RTF control directly (such
as via API calls) and pass it the object to be inserted, or does anyone
have any other suggestions?


You can try to save the clipboard content, then insert the image and restore
the clipboard content.

Regards,
Herfried K. Wagner


Have you tried doing this? There is no clone methods, so it would probably
involve iterating through the data types etc. Very messy and possibly very
memory intensive because you have no idea what is in the clipboard.
Also, I'm not sure if it's even possible given that the clipboard contents
belong to the application that generated them so that the clipboard can be
cleared when the app exits, so it's not a very good solution.

Any other suggestions? Has anyone tried talking to the RTF control through
API calls?

Cheers,
Jason
Nov 20 '05 #3
Hello,

"Jason Sobell" <iG******@hotmail.com> schrieb:
[Insert image into RichTextBox]
Any other suggestions? Has anyone tried talking to the RTF
control through API calls?


http://www.codeproject.com/cs/miscct...ichTextBox.asp

HTH,
Herfried K. Wagner
--
MVP · VB Classic, VB .NET
http://www.mvps.org/dotnet
Nov 20 '05 #4
On Mon, 1 Sep 2003 13:38:15 +0200, Herfried K. Wagner [MVP] wrote:
Hello,

"Jason Sobell" <iG******@hotmail.com> schrieb:
[Insert image into RichTextBox]
Any other suggestions? Has anyone tried talking to the RTF
control through API calls?


http://www.codeproject.com/cs/miscct...ichTextBox.asp

HTH,
Herfried K. Wagner


Yes, I found that one on Google, converted it to VB.Net, but it fell over
whenever an indexed palette image was used.
I'm just surprised that the RTF control is so horribly restrictive.

Cheers,
Jason
Nov 20 '05 #5

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

Similar topics

4
by: Marc Pelletier | last post by:
Hello, I have a class (TideClass) which creates a bitmap image as one of its functions. I want to create a page which has this image embedded amongst some text. I know that I have to stream the...
18
by: J-T | last post by:
Hi All, There is a picture on the following URL which I want to have it in one of my asp.net pages .I mean I want to embed the content of this page in my own page and get its image.Is there a...
0
by: Robin Tucker | last post by:
At the moment I have place-holders in my Word document (before you say it, yes I've posted this query in the VBA newsgroups but they are a little slow - in fact reply was non-existent!). I'm...
7
by: David Thielen | last post by:
Hi; Is there a way to embed images in the response rather than writing them to disk and having an <img ...> tag? And if so, how is it done and what browsers support it? -- thanks - dave
6
by: Edward | last post by:
I have been doing some research about embedding images in HTML using the data URL src method of the format: <img src="/-/data:image/gif;base64,<DATA>"> My question is, how does one generate...
1
by: MissMarie | last post by:
I've been playing around with DIV tables in myspace to better learn how to rewrite my own code for my business site without having to pay someone to design it. I've tried embedding a slideshow into...
0
by: lhoracio | last post by:
Hi, I've got a small app in VB6 with MySQL. Works fine, but I found I would need to embedd some images on text displayed in a RTF control. I have no problem in pasting it to the control....
7
by: pavan anumula | last post by:
I have a requirement When i click on button, i have to initiate an email with the to address, subject, and body should contain an image and the text . Problem : I cannot embed the image using...
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
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
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
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,...
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
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...
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,...
0
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...

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.