当前位置: 首页 > news >正文

【Winform】Gerber文件解析坐标工具代码

Gerber文件解析工具

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

代码

  1. Program.cs
using System;
using System.Windows.Forms;namespace GerberParseTool_v2._0
{internal static class Program{public static string FileName { get; set; }[STAThread]static void Main(){Application.EnableVisualStyles();Application.SetCompatibleTextRenderingDefault(false);Application.Run(new Views.MainForm());}}
}
  1. Models/Aperture.cs
using System;
using System.Collections.Generic;namespace GerberParseTool_v2._0.Models
{public class Aperture{public string ApertureId { get; set; }public double Diameter { get; set; }public List<Tuple<double, double>> Position { get; set; }public Aperture(){Position = new List<Tuple<double, double>>();}public Aperture(string apertureId, double diameter) : this(){ApertureId = apertureId;Diameter = diameter;}public void AddPosition(double x, double y){Position.Add(new Tuple<double, double>(x, y));}public override string ToString(){return $"Aperture {ApertureId}: diameter={Diameter}mm, Position_count={Position.Count}";}}
}
  1. Models/BoundingBox.cs
namespace GerberParseTool_v2._0.Models
{public struct BoundingBox{public double Left { get; }public double Top { get; }public double Right { get; }public double Bottom { get; }public BoundingBox(double left, double top, double right, double bottom){Left = left;Top = top;Right = right;Bottom = bottom;}public double Width => Right - Left;public double Height => Bottom - Top;public double CenterX => (Left + Right) / 2;public double CenterY => (Top + Bottom) / 2;}
}
  1. Models/ViewportParameters.cs
namespace GerberParseTool_v2._0.Models
{public struct ViewportParameters{public double Scale { get; }public float OffsetX { get; }public float OffsetY { get; }public ViewportParameters(double scale, float offsetX, float offsetY){Scale = scale;OffsetX = offsetX;OffsetY = offsetY;}}
}
  1. Services/ApertureParser.cs
using GerberParseTool_v2._0.Models;
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;namespace GerberParseTool_v2._0.Services
{public class ApertureParser{private Dictionary<string, Aperture> _apertureDict;private Aperture _currentAperture;private double _lastX = 0;private double _lastY = 0;public ApertureParser(){_apertureDict = new Dictionary<string, Aperture>();}public Dictionary<string, Aperture> ParseFileContent(string fileContent){_apertureDict.Clear();_currentAperture = null;_lastX = 0;_lastY = 0;string[] lines = fileContent.Split('\n');foreach (string line in lines){string trimmedLine = line.Trim();if (string.IsNullOrEmpty(trimmedLine))continue;ProcessLine(trimmedLine);}return _apertureDict;}private void ProcessLine(string line){if (line.StartsWith("%ADD")){ParseApertureDefinition(line);}else if (IsApertureUsageLine(line)){string apertureId = GetApertureIdFromUsageLine(line);_currentAperture = _apertureDict.ContainsKey(apertureId) ? _apertureDict[apertureId] : null;}else if (IsPositionMoveLine(line)){ParseCoordinateMove(line);}else if (line == "D03*"){if (_currentAperture != null){_currentAperture.AddPosition(_lastX, _lastY);}}}private void ParseApertureDefinition(string line){Regex regex = new Regex(@"%ADD(\d+)C,([\d.]+)");Match match = regex.Match(line);if (match.Success){string apertureId = match.Groups[1].Value;double diameter = double.Parse(match.Groups[2].Value);_apertureDict[apertureId] = new Aperture(apertureId, diameter);}}private bool IsApertureUsageLine(string line){Regex regex = new Regex(@"^D(?!0)\d+\*$");return regex.IsMatch(line);}private bool IsPositionMoveLine(string line){return line.Contains("X") || line.Contains("Y");}private string GetApertureIdFromUsageLine(string line){Regex regex = new Regex(@"^D(\d+)\*$");Match match = regex.Match(line);return match.Success ? match.Groups[1].Value : null;}private void ParseCoordinateMove(string line){double x = _lastX;double y = _lastY;Regex xRegex = new Regex(@"X(-?\d+)");Match xMatch = xRegex.Match(line);if (xMatch.Success){x = double.Parse(xMatch.Groups[1].Value) / 10000.0;_lastX = x;}Regex yRegex = new Regex(@"Y(-?\d+)");Match yMatch = yRegex.Match(line);if (yMatch.Success){y = double.Parse(yMatch.Groups[1].Value) / 10000.0;_lastY = y;}}public List<Aperture> GetApertureList(){return new List<Aperture>(_apertureDict.Values);}}
}
  1. Services/GerberFileService.cs
using GerberParseTool_v2._0.Models;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;namespace GerberParseTool_v2._0.Services
{public class GerberFileService{private readonly ApertureParser _apertureParser;public GerberFileService(){_apertureParser = new ApertureParser();}public List<Aperture> ParseGerberFile(string filePath){if (!File.Exists(filePath))throw new FileNotFoundException($"文件不存在: {filePath}");string gerberContent = File.ReadAllText(filePath);var apertureDict = _apertureParser.ParseFileContent(gerberContent);return apertureDict.Values.ToList();}public List<Aperture> MirrorAperturesVertical(List<Aperture> apertures){if (apertures == null || apertures.Count == 0)return apertures;// 计算Y轴中心线double centerY = CalculateVerticalMirrorLine(apertures);// 执行翻转foreach (var aperture in apertures){var newPositions = aperture.Position.Select(pos => new Tuple<double, double>(pos.Item1, 2 * centerY - pos.Item2)).ToList();aperture.Position.Clear();aperture.Position.AddRange(newPositions);}return apertures;}private double CalculateVerticalMirrorLine(List<Aperture> apertures){double minY = double.MaxValue;double maxY = double.MinValue;bool hasValidPoints = false;foreach (var aperture in apertures){foreach (var position in aperture.Position){double y = position.Item2;if (!double.IsNaN(y) && !double.IsInfinity(y)){minY = Math.Min(minY, y);maxY = Math.Max(maxY, y);hasValidPoints = true;}}}return hasValidPoints ? (minY + maxY) / 2 : 0;}}
}
  1. Helpers/ViewportHelper.cs
using GerberParseTool_v2._0.Models;
using System;
using System.Collections.Generic;
using System.Windows.Forms;namespace GerberParseTool_v2._0.Helpers
{public static class ViewportHelper{public static BoundingBox CalculateBoundingBox(List<Aperture> apertures){if (apertures == null || apertures.Count == 0)return new BoundingBox(0, 0, 0, 0);double minX = double.MaxValue;double minY = double.MaxValue;double maxX = double.MinValue;double maxY = double.MinValue;bool hasValidPoints = false;foreach (var aperture in apertures){if (aperture.Position.Count == 0)continue;foreach (var position in aperture.Position){double x = position.Item1;double y = position.Item2;if (!double.IsNaN(x) && !double.IsInfinity(x) &&!double.IsNaN(y) && !double.IsInfinity(y)){minX = Math.Min(minX, x);minY = Math.Min(minY, y);maxX = Math.Max(maxX, x);maxY = Math.Max(maxY, y);hasValidPoints = true;}}}if (!hasValidPoints)return new BoundingBox(0, 0, 0, 0);// 考虑光圈半径double maxRadius = GetMaxApertureRadius(apertures);minX -= maxRadius;minY -= maxRadius;maxX += maxRadius;maxY += maxRadius;// 确保最小尺寸if (maxX - minX < 1) maxX = minX + 1;if (maxY - minY < 1) maxY = minY + 1;return new BoundingBox(minX, minY, maxX, maxY);}private static double GetMaxApertureRadius(List<Aperture> apertures){double maxRadius = 0;foreach (var aperture in apertures){if (aperture.Diameter > 0){maxRadius = Math.Max(maxRadius, aperture.Diameter / 2);}}return maxRadius;}public static ViewportParameters CalculateViewportParameters(BoundingBox boundingBox, Control canvas, double minScale = 0.1, double maxScale = 100.0){if (canvas == null)return new ViewportParameters(10.0, 0, 0);double centerX = boundingBox.CenterX;double centerY = boundingBox.CenterY;double width = boundingBox.Width;double height = boundingBox.Height;double scaleX = (canvas.Width * 0.8) / Math.Max(width, 1);double scaleY = (canvas.Height * 0.8) / Math.Max(height, 1);double scale = Math.Min(scaleX, scaleY);scale = Math.Max(minScale, Math.Min(maxScale, scale));float offsetX = canvas.Width / 2 - (float)(centerX * scale);float offsetY = canvas.Height / 2 - (float)(centerY * scale);return new ViewportParameters(scale, offsetX, offsetY);}public static ViewportParameters ResetViewToCenter(List<Aperture> apertures, Control canvas, double minScale = 0.1, double maxScale = 100.0){if (apertures == null || apertures.Count == 0 || canvas == null){return new ViewportParameters(10.0, canvas?.Width / 2 ?? 0, canvas?.Height / 2 ?? 0);}var boundingBox = CalculateBoundingBox(apertures);return CalculateViewportParameters(boundingBox, canvas, minScale, maxScale);}}
}
  1. Helpers/ToolHelper.cs
using System;
using System.Drawing;namespace GerberParseTool_v2._0.Helpers
{public static class ToolHelper{/// <summary>/// 检查矩形是否有效/// </summary>public static bool IsValidRectangle(RectangleF rect){try{return rect.Width > 0 &&rect.Height > 0 &&!float.IsNaN(rect.X) && !float.IsNaN(rect.Y) &&!float.IsNaN(rect.Width) && !float.IsNaN(rect.Height) &&!float.IsInfinity(rect.X) && !float.IsInfinity(rect.Y) &&!float.IsInfinity(rect.Width) && !float.IsInfinity(rect.Height) &&rect.X > -100000 && rect.X < 100000 &&rect.Y > -100000 && rect.Y < 100000 &&rect.Width < 100000 && rect.Height < 100000;}catch{return false;}}/// <summary>/// 检查点坐标是否有效/// </summary>public static bool IsValidPoint(float x, float y){try{return !float.IsNaN(x) && !float.IsNaN(y) &&!float.IsInfinity(x) && !float.IsInfinity(y) &&x > -100000 && x < 100000 &&y > -100000 && y < 100000;}catch{return false;}}/// <summary>/// 检查双精度点坐标是否有效/// </summary>public static bool IsValidPoint(double x, double y){try{return !double.IsNaN(x) && !double.IsNaN(y) &&!double.IsInfinity(x) && !double.IsInfinity(y) &&x > -100000 && x < 100000 &&y > -100000 && y < 100000;}catch{return false;}}/// <summary>/// 计算两点之间的距离/// </summary>public static double CalculateDistance(double x1, double y1, double x2, double y2){if (!IsValidPoint(x1, y1) || !IsValidPoint(x2, y2))return 0;double dx = x2 - x1;double dy = y2 - y1;return Math.Sqrt(dx * dx + dy * dy);}/// <summary>/// 限制数值在指定范围内/// </summary>public static double Clamp(double value, double min, double max){return Math.Min(Math.Max(value, min), max);}/// <summary>/// 限制数值在指定范围内/// </summary>public static float Clamp(float value, float min, float max){return Math.Min(Math.Max(value, min), max);}/// <summary>/// 检查坐标是否在边界框内/// </summary>public static bool IsPointInBoundingBox(double x, double y, double left, double top, double right, double bottom){return IsValidPoint(x, y) && x >= left && x <= right && y >= top && y <= bottom;}/// <summary>/// 将毫米转换为像素(根据缩放比例)/// </summary>public static float MillimetersToPixels(double millimeters, double scale){return (float)(millimeters * scale);}/// <summary>/// 将像素转换为毫米(根据缩放比例)/// </summary>public static double PixelsToMillimeters(float pixels, double scale){return scale > 0 ? pixels / scale : 0;}/// <summary>/// 格式化尺寸显示(自动选择单位)/// </summary>public static string FormatDimension(double value){if (Math.Abs(value) < 0.001)return $"{value * 1000000:F1} nm";else if (Math.Abs(value) < 1)return $"{value * 1000:F2} μm";elsereturn $"{value:F3} mm";}/// <summary>/// 安全执行操作,捕获异常/// </summary>public static bool ExecuteSafely(Action action, Action<Exception> errorHandler = null){try{action?.Invoke();return true;}catch (Exception ex){errorHandler?.Invoke(ex);return false;}}}
}
  1. Controllers/MainController.cs

using GerberParseTool_v2._0.Models;
using GerberParseTool_v2._0.Services;
using System;
using System.Collections.Generic;
using System.Linq;namespace GerberParseTool_v2._0.Controllers
{public class MainController{private readonly GerberFileService _gerberService;public List<Aperture> CurrentApertures { get; private set; }public MainController(){_gerberService = new GerberFileService();CurrentApertures = new List<Aperture>();}public List<Aperture> LoadGerberFile(string filePath){try{CurrentApertures = _gerberService.ParseGerberFile(filePath);return CurrentApertures;}catch (Exception ex){throw new Exception($"加载Gerber文件失败: {ex.Message}", ex);}}public List<Aperture> MirrorAperturesVertical(){if (CurrentApertures == null || CurrentApertures.Count == 0)throw new InvalidOperationException("没有可翻转的光圈数据");CurrentApertures = _gerberService.MirrorAperturesVertical(CurrentApertures);return CurrentApertures;}public string GetFileSummary(){if (CurrentApertures == null || CurrentApertures.Count == 0)return "没有加载任何文件";int totalPositions = CurrentApertures.Sum(a => a.Position.Count);return $"已加载 {CurrentApertures.Count} 个光圈,共 {totalPositions} 个坐标点";}}
}
  1. Views/MainForm.cs
using GerberParseTool_v2._0.Controllers;
using GerberParseTool_v2._0.Helpers;
using GerberParseTool_v2._0.Models;
using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.IO;
using System.Windows.Forms;namespace GerberParseTool_v2._0.Views
{public partial class MainForm : Form{private readonly MainController _controller;private double _scale = 10.0;private double _minScale = 0.1;private double _maxScale = 100.0;private float _offsetX = 0;private float _offsetY = 0;private bool _isDragging = false;private Point _lastMousePos;public MainForm(){InitializeComponent();_controller = new MainController();// 设置窗体启动状态this.WindowState = FormWindowState.Maximized;// 事件绑定panel1.Paint += Panel1_Paint;panel1.MouseDown += panel1_MouseDown;panel1.MouseMove += panel1_MouseMove;panel1.MouseUp += panel1_MouseUp;UpdateStatusLabel();}private void Form1_Load(object sender, EventArgs e){// 窗体加载事件}private void button1_Click(object sender, EventArgs e){if (string.IsNullOrEmpty(Program.FileName)){MessageBox.Show("请先选择一个文件!");return;}try{var apertures = _controller.LoadGerberFile(Program.FileName);ResetViewToCenter();MessageBox.Show($"解析完成!{_controller.GetFileSummary()}");}catch (Exception ex){MessageBox.Show($"解析出错: {ex.Message}");}}private void button2_Click(object sender, EventArgs e){using (OpenFileDialog openFileDialog = new OpenFileDialog()){openFileDialog.Title = "选择Gerber文件";openFileDialog.InitialDirectory = "c:\\";openFileDialog.Filter = "Gerber文件 (*.gbr)|*.gbr|所有文件 (*.*)|*.*";openFileDialog.Multiselect = false;if (openFileDialog.ShowDialog() == DialogResult.OK){Program.FileName = openFileDialog.FileName;UpdateStatusLabel();}}}private void btnMirrorVertical_Click(object sender, EventArgs e){try{_controller.MirrorAperturesVertical();panel1.Invalidate();MessageBox.Show("纵向翻转完成!");}catch (Exception ex){MessageBox.Show($"翻转失败: {ex.Message}");}}private void Panel1_Paint(object sender, PaintEventArgs e){if (_controller.CurrentApertures == null || _controller.CurrentApertures.Count == 0)return;Graphics g = e.Graphics;// 设置高质量绘制g.SmoothingMode = SmoothingMode.AntiAlias;g.Clear(panel1.BackColor);// 应用变换:先平移后缩放g.TranslateTransform(_offsetX, _offsetY);g.ScaleTransform((float)_scale, (float)_scale);// 定义颜色数组Color[] colors = new Color[]{Color.Red, Color.Blue, Color.Green, Color.Orange,Color.Purple, Color.Brown, Color.Magenta, Color.Cyan,Color.DarkRed, Color.DarkBlue, Color.DarkGreen, Color.Gold};int colorIndex = 0;// 绘制每个光圈的所有坐标点foreach (var aperture in _controller.CurrentApertures){if (aperture.Position.Count == 0)continue;// 为每个光圈选择颜色Color apertureColor = colors[colorIndex % colors.Length];colorIndex++;// 创建画笔和画刷using (Pen pen = new Pen(apertureColor, 2 / (float)_scale))using (Brush fillBrush = new SolidBrush(Color.FromArgb(80, apertureColor))){// 绘制每个坐标点foreach (var position in aperture.Position){// 直接使用原始坐标(毫米单位)float centerX = (float)position.Item1;float centerY = (float)position.Item2;float diameter = (float)aperture.Diameter;float radius = diameter / 2;// 计算圆的矩形边界RectangleF circleRect = new RectangleF(centerX - radius,centerY - radius,diameter,diameter);// 检查矩形是否有效if (ToolHelper.IsValidRectangle(circleRect)){try{// 绘制填充圆g.FillEllipse(fillBrush, circleRect);// 绘制圆边框g.DrawEllipse(pen, circleRect);}catch (Exception ex){Console.WriteLine($"绘制异常: {ex.Message}");}}}// 在第一个点旁边显示光圈信息if (aperture.Position.Count > 0){var firstPos = aperture.Position[0];float labelX = (float)firstPos.Item1 + 2;float labelY = (float)firstPos.Item2 - 2;if (ToolHelper.IsValidPoint(labelX, labelY)){try{using (Font font = new Font("Arial", 2))using (Brush textBrush = new SolidBrush(apertureColor)){string label = $"D{aperture.ApertureId}{aperture.Diameter}mm)";g.DrawString(label, font, textBrush, labelX, labelY);}}catch (Exception ex){Console.WriteLine($"文本绘制异常: {ex.Message}");}}}}}// 重置变换g.ResetTransform();// 绘制简单的网格(在屏幕坐标中)DrawSimpleGrid(g);}private void DrawSimpleGrid(Graphics g){try{using (Pen gridPen = new Pen(Color.LightGray, 1)){for (int x = 0; x <= panel1.Width; x += 50){if (x >= 0 && x <= panel1.Width){g.DrawLine(gridPen, x, 0, x, panel1.Height);}}for (int y = 0; y <= panel1.Height; y += 50){if (y >= 0 && y <= panel1.Height){g.DrawLine(gridPen, 0, y, panel1.Width, y);}}}}catch{// 忽略网格绘制异常}}private void panel1_MouseDown(object sender, MouseEventArgs e){if (e.Button == MouseButtons.Left){_isDragging = true;_lastMousePos = e.Location;panel1.Cursor = Cursors.SizeAll;}}private void panel1_MouseMove(object sender, MouseEventArgs e){if (_isDragging){_offsetX += e.X - _lastMousePos.X;_offsetY += e.Y - _lastMousePos.Y;_lastMousePos = e.Location;panel1.Invalidate();}}private void panel1_MouseUp(object sender, MouseEventArgs e){if (e.Button == MouseButtons.Left){_isDragging = false;panel1.Cursor = Cursors.Default;}}private void button4_Click(object sender, EventArgs e){panel1.Invalidate();}private void button3_Click(object sender, EventArgs e){MessageBox.Show("勾选区域功能待实现");}private void btnZoomIn_Click(object sender, EventArgs e){ZoomIn();}private void btnZoomOut_Click(object sender, EventArgs e){ZoomOut();}private void btnZoomReset_Click(object sender, EventArgs e){ResetViewToCenter();}private void ZoomIn(){double newScale = _scale * 1.5;if (newScale <= _maxScale){Point mousePos = panel1.PointToClient(Cursor.Position);ZoomAtPoint(mousePos, newScale);}else{MessageBox.Show("已达到最大缩放级别");}}private void ZoomOut(){double newScale = _scale / 1.5;if (newScale >= _minScale){Point mousePos = panel1.PointToClient(Cursor.Position);ZoomAtPoint(mousePos, newScale);}else{MessageBox.Show("已达到最小缩放级别");}}private void ZoomAtPoint(Point zoomCenter, double newScale){float worldX = (zoomCenter.X - _offsetX) / (float)_scale;float worldY = (zoomCenter.Y - _offsetY) / (float)_scale;_scale = newScale;_offsetX = zoomCenter.X - worldX * (float)_scale;_offsetY = zoomCenter.Y - worldY * (float)_scale;panel1.Invalidate();UpdateStatusLabel();}private void ResetViewToCenter(){var viewportParams = ViewportHelper.ResetViewToCenter(_controller.CurrentApertures, panel1, _minScale, _maxScale);_scale = viewportParams.Scale;_offsetX = viewportParams.OffsetX;_offsetY = viewportParams.OffsetY;panel1.Invalidate();UpdateStatusLabel();}private void UpdateStatusLabel(){if (string.IsNullOrEmpty(Program.FileName)){label1.Text = $"Gerber解析工具 v2.0 | 缩放: {_scale:F1}x | 平移: ({_offsetX:F0}, {_offsetY:F0}) | 拖拽平移 | +/- 缩放";}else{label1.Text = $"文件: {Path.GetFileName(Program.FileName)} | 缩放: {_scale:F1}x | 平移: ({_offsetX:F0}, {_offsetY:F0}) | 拖拽平移 | +/- 缩放";}}protected override void OnResize(EventArgs e){base.OnResize(e);panel1.Invalidate();}protected override bool ProcessCmdKey(ref Message msg, Keys keyData){switch (keyData){case Keys.Add:case Keys.Oemplus:ZoomIn();return true;case Keys.Subtract:case Keys.OemMinus:ZoomOut();return true;case Keys.Home:ResetViewToCenter();return true;}return base.ProcessCmdKey(ref msg, keyData);}}
}
  1. Views/MainForm.Designer.cs
namespace GerberParseTool_v2._0.Views
{partial class MainForm{private System.ComponentModel.IContainer components = null;private System.Windows.Forms.Label label1;private System.Windows.Forms.Button button4;private System.Windows.Forms.Button button3;private System.Windows.Forms.Button button2;private System.Windows.Forms.Panel panel1;private System.Windows.Forms.Button button1;private System.Windows.Forms.Button btnZoomIn;private System.Windows.Forms.Button btnZoomOut;private System.Windows.Forms.Button btnZoomReset;private System.Windows.Forms.Button btnMirrorVertical;protected override void Dispose(bool disposing){if (disposing && (components != null)){components.Dispose();}base.Dispose(disposing);}#region Windows Form Designer generated codeprivate void InitializeComponent(){this.label1 = new System.Windows.Forms.Label();this.button4 = new System.Windows.Forms.Button();this.button3 = new System.Windows.Forms.Button();this.button2 = new System.Windows.Forms.Button();this.panel1 = new System.Windows.Forms.Panel();this.button1 = new System.Windows.Forms.Button();this.btnZoomIn = new System.Windows.Forms.Button();this.btnZoomOut = new System.Windows.Forms.Button();this.btnZoomReset = new System.Windows.Forms.Button();this.btnMirrorVertical = new System.Windows.Forms.Button();this.SuspendLayout();// // label1// this.label1.AutoSize = true;this.label1.Location = new System.Drawing.Point(12, 4);this.label1.Name = "label1";this.label1.Size = new System.Drawing.Size(82, 24);this.label1.TabIndex = 12;this.label1.Text = "label1";// // button4// this.button4.Location = new System.Drawing.Point(639, 1247);this.button4.Name = "button4";this.button4.Size = new System.Drawing.Size(174, 80);this.button4.TabIndex = 11;this.button4.Text = "刷新画布";this.button4.UseVisualStyleBackColor = true;this.button4.Click += new System.EventHandler(this.button4_Click);// // button3// this.button3.Location = new System.Drawing.Point(439, 1247);this.button3.Name = "button3";this.button3.Size = new System.Drawing.Size(174, 80);this.button3.TabIndex = 10;this.button3.Text = "勾选区域";this.button3.UseVisualStyleBackColor = true;this.button3.Click += new System.EventHandler(this.button3_Click);// // button2// this.button2.Location = new System.Drawing.Point(239, 1247);this.button2.Name = "button2";this.button2.Size = new System.Drawing.Size(174, 80);this.button2.TabIndex = 9;this.button2.Text = "打开文件";this.button2.UseVisualStyleBackColor = true;this.button2.Click += new System.EventHandler(this.button2_Click);// // panel1// this.panel1.BackColor = System.Drawing.SystemColors.ActiveBorder;this.panel1.Location = new System.Drawing.Point(12, 31);this.panel1.Name = "panel1";this.panel1.Size = new System.Drawing.Size(2500, 1201);this.panel1.TabIndex = 8;// // button1// this.button1.Location = new System.Drawing.Point(34, 1247);this.button1.Name = "button1";this.button1.Size = new System.Drawing.Size(174, 80);this.button1.TabIndex = 7;this.button1.Text = "显示坐标";this.button1.UseVisualStyleBackColor = true;this.button1.Click += new System.EventHandler(this.button1_Click);// // btnZoomIn// this.btnZoomIn.Location = new System.Drawing.Point(833, 1247);this.btnZoomIn.Name = "btnZoomIn";this.btnZoomIn.Size = new System.Drawing.Size(174, 80);this.btnZoomIn.TabIndex = 13;this.btnZoomIn.Text = "放大";this.btnZoomIn.UseVisualStyleBackColor = true;this.btnZoomIn.Click += new System.EventHandler(this.btnZoomIn_Click);// // btnZoomOut// this.btnZoomOut.Location = new System.Drawing.Point(1038, 1247);this.btnZoomOut.Name = "btnZoomOut";this.btnZoomOut.Size = new System.Drawing.Size(174, 80);this.btnZoomOut.TabIndex = 14;this.btnZoomOut.Text = "缩小";this.btnZoomOut.UseVisualStyleBackColor = true;this.btnZoomOut.Click += new System.EventHandler(this.btnZoomOut_Click);// // btnZoomReset// this.btnZoomReset.Location = new System.Drawing.Point(1238, 1247);this.btnZoomReset.Name = "btnZoomReset";this.btnZoomReset.Size = new System.Drawing.Size(174, 80);this.btnZoomReset.TabIndex = 15;this.btnZoomReset.Text = "重置";this.btnZoomReset.UseVisualStyleBackColor = true;this.btnZoomReset.Click += new System.EventHandler(this.btnZoomReset_Click);// // btnMirrorVertical// this.btnMirrorVertical.Location = new System.Drawing.Point(1443, 1247);this.btnMirrorVertical.Name = "btnMirrorVertical";this.btnMirrorVertical.Size = new System.Drawing.Size(174, 80);this.btnMirrorVertical.TabIndex = 16;this.btnMirrorVertical.Text = "纵向翻转";this.btnMirrorVertical.UseVisualStyleBackColor = true;this.btnMirrorVertical.Click += new System.EventHandler(this.btnMirrorVertical_Click);// // MainForm// this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;this.ClientSize = new System.Drawing.Size(2484, 1339);this.Controls.Add(this.btnMirrorVertical);this.Controls.Add(this.btnZoomReset);this.Controls.Add(this.btnZoomOut);this.Controls.Add(this.btnZoomIn);this.Controls.Add(this.label1);this.Controls.Add(this.button4);this.Controls.Add(this.button3);this.Controls.Add(this.button2);this.Controls.Add(this.panel1);this.Controls.Add(this.button1);this.Name = "MainForm";this.Text = "Gerber文件解析器 v2.0";this.Load += new System.EventHandler(this.Form1_Load);this.ResumeLayout(false);this.PerformLayout();}#endregion}
}
http://www.dtcms.com/a/490569.html

相关文章:

  • k8s 网络策略详解--图文篇
  • 伟淼科技深度解析过度营销—告别流量轰炸企业破解营销困局新路径
  • POM思想的理解与示例
  • 案例精选 | 某大型船舶制造集团安全运营服务实践
  • 复习总结最终版:C语言
  • react 无限画布难点和实现
  • 网站开发浏览器wordpress投票类主题
  • Qt_day2
  • DMXAPI |使用1个Key接入主流大模型
  • 三星企业网站建设ppt网站建设需要使用哪些设备
  • 23种设计模式——中介者模式 (Mediator Pattern)详解
  • iOS八股文之 RunLoop
  • zibbix
  • Macbook数据恢复 Disk Drill
  • 公司招聘一个网站建设来做推广制作表情包的软件
  • WebSocket实时通信:Socket.io
  • xml方式bean的配置---实例化bean的方式
  • 212. Java 函数式编程风格 - Java 编程风格转换:命令式 vs 函数式(以循环为例)
  • Ubuntu 24.04 修改 ssh 监听端口
  • 1千元以下做网站的公司wordpress sso插件开发
  • Pytorch神经网络工具箱
  • PyTorch DataLoader 高级用法
  • 怎么做一个网站app吗金华网站建设价格
  • 芷江建设局网站石家庄网站建设公司黄页
  • Excel表----VLOOKUP函数实现两表的姓名、身份证号码、银行卡号核对
  • XMLHttpRequest.responseType:前端获取后端数据的一把“格式钥匙”
  • office便捷办公06:根据相似度去掉excel中的重复行
  • Vue+mockjs+Axios 案例实践
  • http的发展历程
  • Python中使用HTTP 206状态码实现大文件下载的完整指南