Your Ad Here
首页 | 编程语言 | 网站建设 | 游戏天堂 | 冲浪宝典 | 网络安全 | 操作系统 | 软件时空 | 硬件指南 | 病毒相关 | IT 认证
软讯网络 > 编程语言 > .NET > C#.NET > RichTextBox中插入图片的方法
【标  题】:RichTextBox中插入图片的方法
【关键字】:RichTextBox
【来  源】:http://blog.csdn.net/diandian82/archive/2006/08/30/1145167.aspx

RichTextBox中插入图片的方法

Your Ad Here
1.      通过剪切板来实现。
public void InsertImage() {
 string lstrFile = fileDialog.FileName;
 Bitmap myBitmap = new Bitmap(lstrFile);
 // Copy the bitmap to the clipboard.
 Clipboard.SetDataObject(myBitmap);
 // Get the format for the object type.
 DataFormats.Format myFormat = DataFormats.GetFormat (DataFormats.Bitmap);
 // After verifying that the data can be pasted, paste
 if(myRichTextBox.CanPaste(myFormat)) {
    myRichTextBox.Paste(myFormat);
 }
 else {
    MessageBox.Show("The data format that you attempted site" +
      " is not supportedby this control.");
 }
}
 
uClinux简介:【上一篇】
反射:【下一篇】
【相关文章】
  • 动态生成 rtf 并指定给 RichTextBox 控件
  • 学习RichTextBox
  • 快速获得Richtextbox控件指定行文本的方法
  • 如何在RichTextBox中实现Undo功能
  • 【随机文章】
  • mencoder installed
  • PB中如何得到Crosstab中的列名
  • 设置classpath的脚本
  • x-window error message...
  • VIM学习心得一个 ZT
  • 向《软件报》投稿的一篇文章 :VB 图片转换为Byte()和从Byte()中读取图片的捷径
  • 64位微处理器体系结构发展回顾和展望
  • 红宝书(Advanced Bash-Scripting Guide)下载
  • 获得和安装samp_db样例数据库分发包
  • Linux的目录里都装些啥
  • 【相关评论】
    没有相关评论
    【发表评论】
    姓名:
    邮件:
    随机码*
    评论*
          
    |  首 页  |  版权声明  |  联系我们   |  网站地图  |
    CopyRight © 2004-2007 bbb软讯网络 All Rigths Reserved.