GDI+(C#语言)画图保存

我用Graphicsg在picturebox上画了一个图形,怎么保存成图片啊... 我用Graphics g在picturebox上画了一个图形,怎么保存成图片啊 展开
 我来答
近井滴水
2010-06-13 · TA获得超过2163个赞
知道小有建树答主
回答量:170
采纳率:0%
帮助的人:311万
展开全部
看什么格式了。这个定义的保存CAD
Stream s = File.Open(filePath, FileMode.Create,FileAccess.ReadWrite);
BinaryFormatter b = new BinaryFormatter();
for (int i = 0; i < this.getCurrentShapes().Count; i++)
{
b.Serialize(s,this.getCurrentShapes()[i]);
}
s.Close();
这个是二进制数据流。
SaveFileDialog sfd = new SaveFileDialog();
sfd.Filter = "序列化文件 (*.bin)|*.bin";
if (sfd.ShowDialog() == DialogResult.OK)
{
FileStream fs = new FileStream(sfd.FileName , FileMode.Create);
BinaryFormatter bf = new BinaryFormatter();
bf.Serialize(fs, _guiLocations);
fs.Close();

FileStream fs1 = new FileStream(sfd.FileName+"Conn", FileMode.Create);
BinaryFormatter bf1 = new BinaryFormatter();
bf1.Serialize(fs1, _connections);
fs1.Close();
}
this.Activate();
PaintGui();
我用到的就这两种,不过别的和这个方法大同小异吧!
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
浅夏微凉耶
2010-06-13 · TA获得超过1390个赞
知道小有建树答主
回答量:1865
采纳率:0%
帮助的人:729万
展开全部
PictureBox1.Image.Save(filename);
本回答被提问者采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式