从富文本框中复制/提取图像

问题描述:

大家好,

我想从RichTextBox中提取图像并将其保存到文件中.有人可以帮我吗?任何帮助/建议将不胜感激.

预先感谢,
Croody

Hi all,

I would like to extract images from a RichTextBox and save them to file. Can any body help me out? Any help / suggestions will be appreciated.

Thanks in advance,
Croody

http://msdn.microsoft.com/zh-CN/library/aa335488(VS.71).aspx

嘿croody,请检查此链接.
它的作用是获取RichTextBox的内容并将其作为流读取.然后使用SaveDialogBox将该流存储在某个位置!希望能帮助到你! :)
http://msdn.microsoft.com/en-us/library/aa335488(VS.71).aspx

hey croody check this link.
What it does is that it takes the contents of your richtextbox and reads it as a stream. And that stream will be used to store in some location using a SaveDialogBox ! Hope it helps! :)


您好Tarun.K.S,

谢谢您的建议,但实际上我只想复制或提取图像,而不是复制或提取RichTextBox中的所有图像.

Croody
Hi Tarun.K.S,

Thank you for the suggestion but what I actually want to do is to copy or extract just the images and not everything in the RichTextBox.

Croody


NRTFTree-用于C#中的RTF处理 [ ^ ]

该库应具有所需的一切,您可以在此处找到一组示例:

http://nrtftree.sourceforge.net/examples.html [
NRTFTree - A class library for RTF processing in C#[^]

This library should have everything you need, you can find a set of examples here:

http://nrtftree.sourceforge.net/examples.html[^]

Specifically the image node example does exactly what your looking for.