在WinForm C#中的RTB中带有URL的图像/文本 [英] Image/Text with url behind in RTB in WinForm C#

查看:177
本文介绍了在WinForm C#中的RTB中带有URL的图像/文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发WinForm C#中的聊天应用程序.我已经使用RichTextBox作为聊天消息.现在我实际上需要的是:我想发送带有聊天文本的屏幕截图,为此,我需要发送带有聊天文本的图像,以便用户可以单击图像并查看屏幕截图.发送的图像将存储在服务器上.

i am going through in development of Chat App in WinForm C#. I have used RichTextBox for the chat messages. What now i need actually is : i want to send screenshot with the chat text, for this i needs to send image with chat text so that user can click on the image and see the screenshot. Sent image will store on server.

Bitmap img = new Bitmap(btn1.BackgroundImage);
       Clipboard.Clear();
       Clipboard.SetDataObject(img);
       DataFormats.Format myFormat = DataFormats.GetFormat(DataFormats.Bitmap);
       rtbWriteMsg.Paste(myFormat);
       img.Dispose();
       rtbWriteMsg.Focus();


我有一个想法,可以使用上面的代码在RichTextBox中使用图像,但是如何使它与某些url链接?我需要一些主意..我做了傻事,但找不到任何东西...



更新:

如果有人可以帮助我将链接的文本放在RichTextBox中,就像单击此处查看"一样,我也能获得帮助.因此用户可以单击它并查看ScreenShot


在此先感谢.


I have an idea to use the image in RichTextBox with the above code but how can i make it linked with some url? I need some ideas.. i have done goole-ing but couldn''t found anything ...



Update:

If I can also get help if anyone give me an idea to put the linked text in RichTextBoxjust like "Click Here To View". So user can Click on it and View the ScreenShot


Thanks in advance.

推荐答案

请参见
See this[^] SO answer.

/ravi


如果您知道名称(聊天窗口标题栏中的名称),则可以使用 ^ ].捕获图像后,可以将其保存在任何地方.

希望有帮助.
If you know the name (name in the title bar of the chat window) you can use the CaptureDesktopWindow class in GGGUtilities.zip (12.4 KB)[^]. When you have captured the image, you can save it whereever.

Hope that helps.


这篇关于在WinForm C#中的RTB中带有URL的图像/文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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