RichTextBox控件中加入图片
参考一:
-----------------------------------------------------------------------------------------------------------------
原文地址:http://topic.csdn.net/t/20030422/15/1693458.html
我用Image或Bitmap效果一样
System.Drawing.Image myBit=Image.FromFile(@"E:\Tools\photo\Photo\iori.gif",false);
Graphics GraphicsMyg=richTextBox1.CreateGraphics();
GraphicsMyg.DrawImage(myBit,0,0);
GraphicsMyg.ResetTransform();
-----------------------------------------------------------------------------------------------------------------
参考二:
-----------------------------------------------------------------------------------------------------------------
原文地址:http://www.cnblogs.com/tuyile006/articles/816943.html
richTextBox支持图片格式,插入图片的方法如下:
{
openFileDialog1.Filter = " 图片文件|*.jpg|所有文件|*.* " ;
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
Clipboard.SetDataObject(Image.FromFile(openFileDialog1.FileName), false );
richTextBox1.Paste();
}
}
---------------------------------------------------------------------------------------------------------------
参考三:
---------------------------------------------------------------------------------------------------------------
原文地址:http://hi.baidu.com/zengyongheng/blog/item/eb96bb50b570f66384352406.html
richText1.SelStart = x 一般自编的记事本都有“粘贴”项,我们就把这个项加以利用(笔者将之称为“常规粘 Private Sub 图片复制_Click() Private Sub 图片剪切_Click() Private Sub 图片粘贴_Click() Private Sub 常规粘贴_Click() 当你从画图程序复制了图片,用“图片粘贴”将它粘贴到富文本框(或者直接打开了图片 Private Sub 常规复制_Click() Private Sub 常规剪切_Click() |
原帖:http://space.itpub.net/?uid-12639172-action-viewspace-itemid-498337