这个飞行棋的棋盘。。。。
画了之后。。。才发现。。要从0 开始。。。这里先将就的看吧。。。
用代码生成出来的。。。。可能 方法土了点。。。每次画都要想坐标。。。。
附上我的代码。。。希望有大神 提供出 更好的。。。。
- public void ViewShow()
- {
- //i 是格数 J控制格数到哪 k是显示颜色
- //画左一横
- for (int i = 1; i <= 5; i++)
- {
- PictureBox pic = new PictureBox();
- pic.Size = new Size(34, 30);
- pic.Image = Image.FromFile(Application.StartupPath + @"\img\1.jpg");
- pic.Location = new System.Drawing.Point(1+i * 31, 130);
- pic.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
- this.Controls.Add(pic);
- }
- for (int i = 1; i <= 3; i++)
- {
- PictureBox pic = new PictureBox();
- pic.Size = new Size(34, 30);
- pic.Image = Image.FromFile(Application.StartupPath + @"\img\1.jpg");
- pic.Location = new System.Drawing.Point( 155, 5+i*31);
- pic.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
- this.Controls.Add(pic);
- }
- for (int i = 1; i <= 7; i++)
- {
- PictureBox pic = new PictureBox();
- pic.Size = new Size(34, 30);
- pic.Image = Image.FromFile(Application.StartupPath + @"\img\1.jpg");
- pic.Location = new System.Drawing.Point(125 + i * 31, 5);
- pic.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
- this.Controls.Add(pic);
- }
- for (int i = 1; i <= 3; i++)
- {
- PictureBox pic = new PictureBox();
- pic.Size = new Size(34, 30);
- pic.Image = Image.FromFile(Application.StartupPath + @"\img\1.jpg");
- pic.Location = new System.Drawing.Point(342, 5 + i * 31);
- pic.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
- this.Controls.Add(pic);
- }
- for (int i = 1; i <= 5; i++)
- {
- PictureBox pic = new PictureBox();
- pic.Size = new Size(34, 30);
- pic.Image = Image.FromFile(Application.StartupPath + @"\img\1.jpg");
- pic.Location = new System.Drawing.Point(311+i * 31, 129);
- pic.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
- this.Controls.Add(pic);
- }
- for (int i = 1; i <= 6; i++)
- {
- PictureBox pic = new PictureBox();
- pic.Size = new Size(34, 30);
- pic.Image = Image.FromFile(Application.StartupPath + @"\img\1.jpg");
- pic.Location = new System.Drawing.Point(466, 129+i*31);
- pic.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
- this.Controls.Add(pic);
- }
- for (int i = 1; i <= 5; i++)
- {
- PictureBox pic = new PictureBox();
- pic.Size = new Size(34, 30);
- pic.Image = Image.FromFile(Application.StartupPath + @"\img\1.jpg");
- pic.Location = new System.Drawing.Point(311 + i * 31, 315);
- pic.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
- this.Controls.Add(pic);
- }
- for (int i = 1; i <= 3; i++)
- {
- PictureBox pic = new PictureBox();
- pic.Size = new Size(34, 30);
- pic.Image = Image.FromFile(Application.StartupPath + @"\img\1.jpg");
- pic.Location = new System.Drawing.Point(342, 315 + i * 31);
- pic.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
- this.Controls.Add(pic);
- }
- for (int i = 1; i <= 7; i++)
- {
- PictureBox pic = new PictureBox();
- pic.Size = new Size(34, 30);
- pic.Image = Image.FromFile(Application.StartupPath + @"\img\1.jpg");
- pic.Location = new System.Drawing.Point(125+i*31, 439);
- pic.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
- this.Controls.Add(pic);
- }
- for (int i = 1; i <= 3; i++)
- {
- PictureBox pic = new PictureBox();
- pic.Size = new Size(34, 30);
- pic.Image = Image.FromFile(Application.StartupPath + @"\img\1.jpg");
- pic.Location = new System.Drawing.Point(156, 439 - i * 31);
- pic.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
- this.Controls.Add(pic);
- }
- for (int i = 1; i <= 5; i++)
- {
- PictureBox pic = new PictureBox();
- pic.Size = new Size(34, 30);
- pic.Image = Image.FromFile(Application.StartupPath + @"\img\1.jpg");
- pic.Location = new System.Drawing.Point(187-i*31, 315);
- pic.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
- this.Controls.Add(pic);
- }
- for (int i = 1; i <= 5; i++)
- {
- PictureBox pic = new PictureBox();
- pic.Size = new Size(34, 30);
- pic.Image = Image.FromFile(Application.StartupPath + @"\img\1.jpg");
- pic.Location = new System.Drawing.Point(32, 315-i*31);
- pic.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
- this.Controls.Add(pic);
- }
- }
复制代码 搞了一个晚上的 求加技术分。。。。
|