是否可以在C#winform中的Richtextbox中加载包含文本和图像的rtf文件 [英] Is it possible to load rtf file having text and image in Richtextbox in C# winform

查看:377
本文介绍了是否可以在C#winform中的Richtextbox中加载包含文本和图像的rtf文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

1。上次我问如何在richtextbox中加载具有图像和文本文件的rtf文件

在C#winform

2.我没有得到答案所以我再次问是否有可能在C#winform中加载富文本框中的图像和文本的rtf文件?
3.如果不可能,请告诉我其他选项,以便我以正确的格式显示此rtf文件

3.编辑文档时是否可以检查rtf文件格式是否已损坏

1. Last time I asked question that how to load rtf file having images and text file in richtextbox
in C# winform
2. I didn't get answer so here i again ask a question whether it is possible to load rtf file having images and text in richtextbox in C# winform?
3. If not possible tell me other options also so that i will display this rtf file in proper format
3. Is it possible to check that rtf file format is corrupted when editing document

推荐答案

是的,我刚试过:

1)在Word中创建了一个新文件,包含一行文本,一行斜体文本和一个JPG图像。

2)保存文件为RTF。

3)使用十六进制编辑器确保嵌入图像。它是,我可以看到图像二进制数据。

4)在表格上删除了一个RichTextBox

5)添加了一个按钮

6)处理按钮点击事件:

Yes, I just tried:
1) Created an new file in Word, with a line of text, a line of italic text and a JPG image.
2) Saved file as RTF.
3) Used a hex editor to ensure the image was embedded. It was, I could see the image binary data.
4) Dropped a RichTextBox on a form
5) Added a button
6) Handled the button click event:
private void myButton_Click(object sender, EventArgs e)
     {
     myRichTextBox.LoadFile(@"D:\Temp\MyRtf.rtf");
     }



7)Ran程序,按下按钮。

8)查看文字和图片......


7) Ran program, pressed button.
8) Looked at text and picture...


这篇关于是否可以在C#winform中的Richtextbox中加载包含文本和图像的rtf文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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