我是根据输入个个数来画矩阵的,比如,输入4
就画出一个指定大小的4*4的矩阵来
然后我用的是FILLRETANGLE来话填充矩阵来填充它!
就画出一个指定大小的4*4的矩阵来
然后我用的是FILLRETANGLE来话填充矩阵来填充它!
解决方案 »
- 请问这段代码,为什么出问题呢
- asp.net上传视频转换为flv格式,并截图,为什么实现不了啊,在线等,急!!
- 字符数组的拆解和替换
- 在线等(windows mobile) 简单问题 回答有分。。。。
- 怎样建立一个MVC的框架,winform而不是Webform
- C#中 如何用winsocket 控件传送 图片(像QQ那样在 internet 中传送)
- 关于Marshal.StructureToPtr的问题
- 怎样实现对DataSet的多个表中的记录进行查询?加急!!!
- 那里有oracle 公司提供的Oracle Provider For .Net 下载?
- C#构造josn格式
- C#中Form1的菜单要直接关联Form2菜单的功能,该怎么办?
- 正则表达式
string str = textBox1.Text;
n = int.Parse(str);
Graphics g = pictureBox1.CreateGraphics();
//Image myimage = new Bitmap(600, 800);
pictureBox1.Image = myimage;
g = Graphics.FromImage(myimage);
Pen BluePen = new Pen(Color.Blue);
float x =80.00F;
float y = 50.00F;
float d = 300.00F/n; for (int i = 0; i <=n;i++ )
{
PointF X1 = new PointF(x + i*d, y);
PointF X2 = new PointF(x + i*d, y + 300.00F);
g.DrawLine(BluePen, X1, X2); }
x = 80.00F;
for (int j = 0; j <=n;j++ )
{
PointF Y1 = new PointF(x, y + j*d);
PointF Y2 = new PointF(x + 300.00F, y + j*d);
g.DrawLine(BluePen, Y1, Y2); }
//重新初始化
x = 80.00F;
y = 50.00F;
//填充
Graphics g = pictureBox1.CreateGraphics();
Image myimage = new Bitmap(600, 800);
pictureBox1.Image = myimage;
g = Graphics.FromImage(myimage); Pen BluePen = new Pen(Color.Blue);
SolidBrush MyBrush=new SolidBrush(Color.Red);
float x =80.00F;
float y = 50.00F;
float d = 300.00F/n;
if(e.X>x&&e.X<x+d&&e.Y<y+d&&e.Y>y)
{
g.FillRectangle(MyBrush,x,y,d,d);
}