c#用draw画的临时图形如何转变成永久图片? 如题。我想把用draw画的图片存储起来怎么办啊?或者,让画好的图片在窗口最小化又恢复后不消失(不能重新再画。在paint事件中的总是重新画,速度太慢)。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 找个函数截屏然后存到某个BMP里吧 目前暂时只想到这一条出路 vb.net好象就可以。但我没找到c#的。截屏不大好吧 public void Get_Img(string a_strUrl, int timeout, string filepath){ try { HttpWebRequest request1 = (HttpWebRequest) WebRequest.Create(a_strUrl); request1.Timeout = timeout; Stream stream1 = ((HttpWebResponse) request1.GetResponse()).GetResponseStream(); Bitmap bitmap1 = new Bitmap(stream1); PictureBox box1 = new PictureBox(); box1.set_Image(bitmap1); string text1 = filepath.Substring(0, filepath.LastIndexOf(@"\")); if (!Directory.Exists(text1)) { this.CreateDir(text1); } box1.get_Image().Save(filepath); } catch (Exception exception1) { string text2 = exception1.Message; this.WriteLog(filepath.Substring(0, filepath.LastIndexOf(@"\")) + @"\error.log", a_strUrl + "--" + text2 + "\r\n"); }} 注意 box1.get_Image().Save(filepath);看得出思路没有? 利用PaintEventArgs参数的ClipRectangle属性来获取剪切区。调用OnPaint()时进行局部重绘。 系统设置未 初始化 怎么向数据库中写入一个word文件? 请问如何生成10位永不重复的随机数? RichTextBox的排列问题,高手帮忙! 求SQL语句!!!!! 关于串口的问题 为什么一个类中只可以有一种索引器?? WIN7 FTP服务器的问题 请教,一个小问题! 一个关于对话框的问题 能否利用代码实现SN.EXE的功能? 在C#中如何将excel中的数据倒入到sql server中啊?
截屏不大好吧
{
try
{
HttpWebRequest request1 = (HttpWebRequest) WebRequest.Create(a_strUrl);
request1.Timeout = timeout;
Stream stream1 = ((HttpWebResponse) request1.GetResponse()).GetResponseStream();
Bitmap bitmap1 = new Bitmap(stream1);
PictureBox box1 = new PictureBox();
box1.set_Image(bitmap1);
string text1 = filepath.Substring(0, filepath.LastIndexOf(@"\"));
if (!Directory.Exists(text1))
{
this.CreateDir(text1);
}
box1.get_Image().Save(filepath);
}
catch (Exception exception1)
{
string text2 = exception1.Message;
this.WriteLog(filepath.Substring(0, filepath.LastIndexOf(@"\")) + @"\error.log", a_strUrl + "--" + text2 + "\r\n");
}
}