将图形转换成图像 [英] Convert Graphics in to Image

查看:98
本文介绍了将图形转换成图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否存在将图形转换为图像的方法?

Is there is a method to convert graphics in to an image?

推荐答案

是的!有一些从图形绘制图像的过程,但是要完成此任务,您应该已经有一个图像.如果没有,则可以创建一个并吸引到该对象.
yeah! there is process to draw Image from graphics but to accomplish this task you should already have an Image. if you don''t have then you can create one and draw to that one.
Image bmp = new Bitmap(width, height);
using (Graphics g = Graphics.FromImage(bmp)) {
    // draw in bmp using g
}
bmp.Save(filename);




参考链接:-将图形转换为图像 [ MSDN- [Graphics.FromImage方法] [^ ]




Reference Link :- Convert Graphics in to Image[^]
and for getting better details have a look there MSDN-[Graphics.FromImage Method][^]


这篇关于将图形转换成图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆