如何在C#中绘制图片... [英] How to draw pictures en c#...

查看:167
本文介绍了如何在C#中绘制图片...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在c#..中绘制关于人类价值(无论哪个)的图形,而无需插入图像...所有内容都必须通过代码绘制.
您必须使用DrawEllipse ...等..

有人可以帮助我吗?我不知道该如何开始!!!!!

任何解决方案都可以回复此电子邮件
[删除] @ gmail.com

I need to do a graphics about a human value (whichever) in c # .. without inserting images ... everything must be drawn by code.
You must use DrawEllipse ... etc. ..

Someone could help me, please ????? I have no idea how to start !!!!!

any solution respond to this email
[removed]@gmail.com

推荐答案

在draw/ing名称空间中使用Graphic类
然后将表单/面板....实例传递给它

use Graphic class in draw/ing namespace
then pass your form/panel.... instance to it

Graphic g= Form1.CreateGraphic(); //(or some thing like this..)


然后您可以调用g并在其后加上点(''.''),然后将显示所有绘图功能.

您可以从画笔中创建画笔,从颜色中创建挫伤...(我不确定,您是否可以阅读工具提示)


then u can call g and put dot (''.'') after it and all function of drawing will appear .

you can crate pen from brushes and bruses from color ...(i''m not sure, you can see if you read tool tips)

Brush b = new SolidBrush(Color.Red);

Pen p = new Pen(brush 1);


还有最后一件事...
如果您需要保留数据并用dpont销毁它们,请首先生成一个缓冲区...
像:


and last thing...
if you need to keep data, and dpont let them destroy, first generate a buffer...
like:

Bitmap bmp=new Bitmap();

现在而不是我上面使用过的东西:

now instead of the thing i tol you above use:

Graphics g= Graphics.FromImage(bmp); //(i'm not sure... it's some thing like this)

//Draw codes
PictureBox1.Image=bmp;


以这种形式,您可以在Image样式变量中缓冲数据,然后将该变量作为图像传递给image Box的image属性...


in this form, you buffer data in Image style variable, and then pass this variable as an image to your image property of image Box...


这篇关于如何在C#中绘制图片...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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