关于C#图片问题 因为项目需要,需要把图片可以粘贴到form上面,比如word那样子性质的插入图片。请问有什么好办法。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 资源文件设置form背景richetextbox粘贴图片private void richTextBox1_KeyDown(object sender, KeyEventArgs e) { if (e.Control && e.KeyCode == Keys.V) { e.SuppressKeyPress = true; richTextBox1.Paste(DataFormats.GetFormat(DataFormats.Text)); } } 2楼+1.DataFormats.Text中的文本该为图片就好 richTextBox1.Paste(DataFormats.GetFormat(DataFormats.Dib)); 文本框里还可以粘贴图片啊,我一般是将图片读取到pictureBoxprivate void loadButton_Click(object sender, EventArgs e){ openFileDialog1.Filter = "bmp | *.bmp"; if (openFileDialog1.ShowDialog() == DialogResult.OK) { bmp = new Bitmap(openFileDialog1.FileName); pictureBox1.Image = bmp; }} 我就是不想用picturebox 所以才来问大家的 关于 C#的datacolumn语句的理解 调用WCF时报错:configuration section cannot be created 如何实现listbox的数据过滤 点击TextBox把光标置于其内时显示一个日历控件的代码怎么写? 怎么判断窗体已存在? 关于.net的全文检索 线程中改控件的text的问题 怎样获取Assembly的timestamp 值 ping 延迟和程序延迟不一样。 帮忙求教ExecuteReader()问题? 这个是什么问题 这个数据库连接是否需要关闭?
richetextbox粘贴图片private void richTextBox1_KeyDown(object sender, KeyEventArgs e)
{
if (e.Control && e.KeyCode == Keys.V)
{
e.SuppressKeyPress = true;
richTextBox1.Paste(DataFormats.GetFormat(DataFormats.Text));
}
}
DataFormats.Text中的文本该为图片就好
{
openFileDialog1.Filter = "bmp | *.bmp";
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
bmp = new Bitmap(openFileDialog1.FileName);
pictureBox1.Image = bmp;
}
}