各位大佬,在下小白一枚,由于工作需要,编写此代码,希望能帮到有需要的人。
int X, Y;//定义原点像素点,以后内容根据相对坐标完成
X = 665;
Y = 329;//先设置为625,329,以后根据实际情况调节600*600的框的中心,左上角坐标为365,29
Graphics g = this.CreateGraphics();
Pen pen_zuobiaotu = new Pen(Brushes.Black);
Point X_L = new Point(365, 329);
Point X_R = new Point(965, 329);
Point Y_U = new Point(665, 29);
Point Y_D = new Point(665, 629);
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; // 图形抗锯齿
g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias; // 文字抗锯齿
//绘制网格线
for (int i = 0; i <= 30; i++)
{
Point px1 = new Point(X - 300, Y + 300 - ((600 / 30) * i));
Point px2 = new Point(X + 300,