using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Text; using System.Windows.Forms; using System.Drawing.PRinting; using System.Drawing.Drawing2D; //计算屏幕像素大小和mm大小引用 using System.Runtime.InteropServices;
namespace UntilityControl { public partial class RuleAndGrid : UserControl { public Control useControl; private TextBox lineX=new TextBox(); private TextBox lineY=new TextBox(); private TextBox rectangleX=new TextBox(); private TextBox rectangleY=new TextBox(); Pen penG = new Pen(Color.Black); Pen penL = new Pen(Color.Red); Font font = new Font("宋体", 8); public RuleAndGrid() { InitializeComponent(); } public Panel panel1 = new Panel(); //每毫米占的像素数 float pxwidth;