将资源中的图像添加到RichTextBox [英] Add image from resources to richtextbox

查看:92
本文介绍了将资源中的图像添加到RichTextBox的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个基于vb.net的窗口应用程序.

我将图像添加到项目资源(myImage.bmp).如何在鼠标单击事件(假设按钮单击)上将此图像添加到我的richTextBox中.

任何帮助都会得到很大的帮助.

谢谢



i have a vb.net based window application.

I added an image to the project resources (myImage.bmp). How can i add this image to my richTextBox on mouse click event (suppose on button click).

Any assistance will be greatly received.

Thanks

推荐答案

请找到此链接,这可能非常有用
Please find this link, this might be very useful csexrichtextbox
And if you want to read images from Project Resource then you can use the code sample below;
System.Drawing.Image tempImage = MyProject.Properties.Resources.myImage;
Clipboard.SetDataObject(tempImage);
DataFormats.Format image = DataFormats.GetFormat(DataFormats.Bitmap);
richTextBox1.Paste(image);


这篇关于将资源中的图像添加到RichTextBox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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