棋盘总代码
namespace zzz
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Point pt0 = new Point(100, 100);
int width = 20;
var g = pictureBox1.CreateGraphics();
g.Clear(Color.White);
var pen = new Pen(Color.Blue);
g.DrawRectangle(pen, pt0.X, pt0.Y, width * 18, width * 18);
for (int line = 0; line < 18; line++)
{
int i = 0;
for (i = 0; i < 18; i++)
{
g.DrawRectangle(pen, i * 1 * width + pt0.X, 1 * line * width + pt0.Y, width, width);
}
for (i = 0; i < 18; i++)
{
}
}
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
}
效果
巴基斯坦国旗呈长方形,长与宽之比为3:2。左侧是白色竖长方形,宽度占整个旗面的1/4;右侧为深绿色长方形,中央有一颗白色五角星和一弯白色新月。白色象征和平,代表国内信奉印度教、佛教、基督教、祆教的居民和其他少数民族;绿色象征繁荣,还代表伊斯兰教。新月象征进步,五角星象征光明;新月和五角星还象征对伊斯兰教的信仰。
两个圆弧圆心和五角星中心都在同一条对角线上。
cad图
目前进度:
代码实现
namespace _333
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Point pt0 = new Point(10, 10);
int width = 15;
var g = pictureBox1.CreateGraphics();
g.Clear(Color.White);
var pen = new Pen(Color.Black);
var brush = new SolidBrush(Color.Red);
g.DrawRectangle(pen, pt0.X, pt0.Y, width * 32, width * 24);
g.DrawRectangle(pen, pt0.X, pt0.Y, width * 32/4, width * 24);
var g3 = this.pictureBox1.CreateGraphics();
SolidBrush solidBrush0 = new SolidBrush(Color.Green);
Point point11 = new Point(130, 10);
Point point12 = new Point(490, 10);
Point point13 = new Point(130, 371);
Point point14 = new Point(490, 371);
Point[] points1 = { point14, point13, point11, point12 };
g.FillPolygon(solidBrush0, points1, System.Drawing.Drawing2D.FillMode.Alternate);
var g1 = this.pictureBox1.CreateGraphics();
SolidBrush redBrush = new SolidBrush(Color.White);
Point point1 = new Point(106*3, 73*3);
Point point2 = new Point(110*3, 67*3);
Point point3 = new Point(117*3, 71*3);
Point point5 = new Point(118*3, 58*3);
Point point4 = new Point(113*3, 64*3);
Point point6 = new Point(111*3, 60*3);
Point point7 = new Point(107*3, 54*3);
Point point8 = new Point(107*3, 61*3);
Point point9 = new Point(100*3, 63*3);
Point point10 = new Point(106*3, 66*3);
Point[] points = { point1, point2, point3, point4, point5, point6, point7, point8, point9, point10 };
g1.FillPolygon(redBrush, points, System.Drawing.Drawing2D.FillMode.Alternate);
}
private void pictureBox1_Click(object sender, EventArgs e)
{
}
}
}
测量数据