richtextbox的问题...... [英] Problem with richtextbox....

查看:81
本文介绍了richtextbox的问题......的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我是
我正在尝试构建一个信使类型的消息,其中的图像和文本插入到vb.net的richtextbox中。

通过复制它们插入图像首先是剪贴板,然后在Richtextbox中使用粘贴命令。

我遇到的问题是我想将对话保存到DB Mysql,但不返回所生成的richtextbox的所有RTF编码图像,但只有每个图像的参考代码将由系统转换回图像
,当再次阅读对话以显示时。



问题是,为了做到这一点,我希望能够在剪贴板粘贴后(例如注释或通用信息)在RTF中的图像块内的某处插入此代码仍然允许您查看图片但未显示此代码
给用户。

这样我就可以保存会话拦截所有这些代码,这些代码与对话一起文本应该保存在远程数据库上。



如果您有任何想法...

谢谢。

解决方案

我正在尝试构建一个信使类型的消息,其中的图像和文本插入到vb.net的richtextbox中。

图像通过复制插入首先是剪贴板,然后在Richtextbox中使用粘贴命令。

当您进行粘贴时,您需要以某种方式识别图像(可能是唯一的文本代码)并创建一个记录与之关联的图像引用。这可能是实际的字符串,或者是为此目的创建的类。


然后,在保存文本之前,您需要解析RTF并使用合适的替换图像元素包含图像参考的替代元素。  要做到这一点,你需要解析RTF,最简单的方法是首先将它转换为XML:

https://sourceforge.net/projects/rtf2xml/


http://www.biblioscape.com/rtf15_spec.htm


Hello,
I'm trying to build a messenger type message with images and text inserted into a richtextbox in vb.net.
Images are inserted by copying them first to clipboard and then using the paste command in the Richtextbox.
The problem I'm encountering is that I want to save the conversation to DB Mysql, but not return all RTF encoding of the richtextbox produced for the images, but only a reference code for each of them that will be translated by the system back into the image , When the conversation will be read again to be displayed.

The problem is that in order to do this I would like to be able to insert this code somewhere within the image block in RTF after the clipboard paste (such as notes or generic information) that still allows you to view the image but without showing This code to the user.
This would allow me to save the conversation intercepting all these codes, which along with the conversation text should be saved on the remote DB.

If you have any idea ...
Thank you.

解决方案

I'm trying to build a messenger type message with images and text inserted into a richtextbox in vb.net.
Images are inserted by copying them first to clipboard and then using the paste command in the Richtextbox.

When you do the paste you will need to identify the image somehow (perhaps a unique text code) and create a record for the image reference that is associated with it. That could be the actual string, or a class that you create for the purpose.

Then, before text is saved, you need to parse the RTF and replace the image element with a suitable alternative element that contains the image reference.   To do this you would need to parse the RTF, and the simplest way to do this might be to convert it to XML first:
https://sourceforge.net/projects/rtf2xml/

http://www.biblioscape.com/rtf15_spec.htm


这篇关于richtextbox的问题......的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆