| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011 |
- using PaintDotNet.CustomControl;
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Drawing.Drawing2D;
- using System.Drawing.Imaging;
- using System.Windows.Forms;
- namespace PaintDotNet.DedicatedAnalysis.NonferrousMetals.YYT098814_2016
- {
- /// <summary>
- /// 组织界面梯度法
- /// </summary>
- internal class TABMethod4DialogSetting : PdnBaseForm
- {
- #region 基础控件
- private Button button2;
- private GroupBox groupBox3;
- private ImageList imageList1;
- private IContainer components;
- private GroupBox groupBox1;
- #endregion
- /// <summary>
- /// 调色板
- /// </summary>
- PaintDotNet.ColorsForm colorsForm1;
- PaintDotNet.ColorsForm colorsForm2;
- PaintDotNet.ColorsForm colorsForm3;
- PaintDotNet.ColorsForm colorsForm4;
- PaintDotNet.ColorsForm colorsForm5;
- /// <summary>
- /// 主控件
- /// </summary>
- private AppWorkspace appWorkspace;
- /// <summary>
- /// 图像面板
- /// </summary>
- private DocumentWorkspaceWindow documentWorkspace;
- /// <summary>
- /// 公共按钮
- /// </summary>
- private CommonControlButtons commonControlButtons;
- /// <summary>
- /// 检测到的轮廓
- /// </summary>
- OpenCvSharp.Point[][] contours;
- /// <summary>
- /// 选中图片的bitmap
- /// </summary>
- private Bitmap bitmap;
- /// <summary>
- /// 选择标尺的物理长度(微米/像素)
- /// </summary>
- double physical_length = 1;
- /// <summary>
- /// 图像的物理长度
- /// </summary>
- int physical_width = 1200;
- /// <summary>
- /// 0:添加 1:选择 2:删除
- /// </summary>
- private int operationK = -1;
- /// <summary>
- /// 被选择的线
- /// </summary>
- private int selected = -1;
- /// <summary>
- /// 起止点
- /// </summary>
- private System.Drawing.PointF startPoint, endPoint;
- /// <summary>
- /// 存储所有线的点集合
- /// </summary>
- private List<PointF[]> pointList = new List<PointF[]>();
- /// <summary>
- /// 测量点
- /// </summary>
- public List<RectangleF> rectangleFList = new List<RectangleF>();
- /// <summary>
- /// 存储当前线的点集合
- /// </summary>
- private PointF[] nowLine;
- /// <summary>
- /// 线的总数
- /// </summary>
- private int lineCount = 0;
- /// <summary>
- /// 计算结果的表格集合
- /// </summary>
- private List<DataTable> resultTableList = new List<DataTable>();
- /// <summary>
- /// 保存用于生成报告的图片
- /// </summary>
- private List<Bitmap> bitList;
- /// <summary>
- /// 储存点击保存结果后的所有原图与分析图
- /// </summary>
- private Dictionary<string, List<Bitmap>> bitDic = new Dictionary<string, List<Bitmap>>();
- /// <summary>
- /// 是否显示全部
- /// </summary>
- private bool showAll = false;
- /// <summary>
- /// 辅助计算偏移量-移动线两端的点
- /// </summary>
- private PointF lastPoint = new PointF(0, 0);
- /// <summary>
- /// 辅助计算偏移量-移动线中间的点
- /// </summary>
- private PointF tempPoint = new PointF(0, 0);
- /// <summary>
- /// 判断图形是否可移动
- /// </summary>
- private bool canMove = false;
- /// <summary>
- /// 调色板
- /// </summary>
- private ColorsForm colorsFormGrid;
- private Panel panelC;
- private Button button10;
- private GroupBox groupBox6;
- private Panel panel3;
- private TrackBar trackBar4;
- private TextBox textBox10;
- private Label label4;
- private Label label6;
- private GroupBox groupBox2;
- private Panel panel6;
- private TrackBar trackBar1;
- private TextBox textBox1;
- private Label label8;
- private Label label9;
- private Panel panel9;
- private TrackBar trackBar6;
- private TextBox textBox6;
- private Label label13;
- private Label label14;
- private Panel panel8;
- private TrackBar trackBar5;
- private TextBox textBox4;
- private Label label11;
- private Label label12;
- private Panel panel1;
- private TrackBar trackBar2;
- private TextBox textBox2;
- private Label label3;
- private Label label5;
- private GroupBox groupBox4;
- private Panel panel7;
- private TextBox textBox3;
- private TrackBar trackBar3;
- private TextBox textBox5;
- private Label label10;
- private Label label16;
- private Label label18;
- private GroupBox groupBox7;
- private Panel panel4;
- private TrackBar trackBar7;
- private TextBox textBox9;
- private Label label1;
- private Label label2;
- /// <summary>
- /// 移动线上的哪一个点
- /// </summary>
- private int movePointIndex = -1;
- private GroupBox groupBox5;
- private Panel panel2;
- private TrackBar trackBar8;
- private TextBox textBox7;
- private Label label7;
- private Label label15;
- private TABM4Dialog parentDialog;
- public TABMethod4DialogSetting(TABM4Dialog parent, AppWorkspace appWorkspace, int focusedItemIndex)
- {
- this.parentDialog = parent;
- this.appWorkspace = appWorkspace;
- InitializeComponent();
- InitializeLanguageText();
- //
- //初始化色板
- //
- this.colorsFormGrid = new ColorsForm();
- this.colorsFormGrid.StartPosition = FormStartPosition.CenterScreen;
- this.colorsFormGrid.setSaveBtn_Click(new System.EventHandler(this.gridColorChanged));
- InitOtherTools();
- if (focusedItemIndex > -1)
- {
- this.bitmap = new Bitmap(1200, 900, PixelFormat.Format32bppRgb/*Format32bppArgb*/);
- Bitmap bitmap11 = this.appWorkspace.DocumentWorkspaces[focusedItemIndex].CompositionSurface.CreateAliasedBitmap();
- //Dictionary<MeasurementUnit, double> measurementUnitDictionary = Startup.instance.rules;
- double physical_length11 = this.appWorkspace.DocumentWorkspaces[focusedItemIndex].GetRuler(MeasurementUnit.Micron);
- //double physical_length11 = measurementUnitDictionary[MeasurementUnit.Micron];
- physical_width = (int)(bitmap11.Width * physical_length11);
- }
- else
- this.bitmap = new Bitmap(1200, 900, PixelFormat.Format32bppRgb/*Format32bppArgb*/);
- //this.bitmap = new Bitmap(1200, 900, PixelFormat.Format32bppRgb/*Format32bppArgb*/);// this.appWorkspace.DocumentWorkspaces[focusedItemIndex].CompositionSurface.CreateAliasedBitmap();
- Document document = Document.FromImage(bitmap);
- this.documentWorkspace.Document = document;
- this.documentWorkspace.Visible = true;
- InitCommonButtonEvent();
- AddPictureBoxEvent();
- InitVariableParams();
- }
- /// <summary>
- /// 限制只可以输入0-9数字以及退格键
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void textBoxWidth_KeyPress(object sender, KeyPressEventArgs e)
- {
- if (e.KeyChar != '\b')//这是允许输入退格键
- {
- int len = ((TextBox)sender)/*this.textBox1*/.Text.Length;
- if (len < 1 && e.KeyChar == '0')
- {
- e.Handled = true;
- }
- else if ((e.KeyChar < '0') || (e.KeyChar > '9'))//这是允许输入0-9数字
- {
- e.Handled = true;
- }
- }
- }
- private void InitVariableParams()
- {
- this.trackBar8.Value = this.parentDialog.rectLineWidth;
- this.textBox7.Text = this.trackBar8.Value.ToString();
- this.trackBar1.Value = this.parentDialog.baseLineWidth;
- this.textBox1.Text = this.trackBar1.Value.ToString();
- this.trackBar3.Value = this.parentDialog.scopeLineWidth;
- this.textBox5.Text = this.trackBar3.Value.ToString();
- this.trackBar4.Value = this.parentDialog.orgLineWidth;
- this.textBox10.Text = this.trackBar4.Value.ToString();
- this.trackBar2.Value = this.parentDialog.rect1LineWidth;
- this.textBox2.Text = this.trackBar2.Value.ToString();
- this.trackBar5.Value = this.parentDialog.rect2LineWidth;
- this.textBox4.Text = this.trackBar5.Value.ToString();
- this.trackBar6.Value = this.parentDialog.rect3LineWidth;
- this.textBox6.Text = this.trackBar6.Value.ToString();
- this.trackBar7.Value = this.parentDialog.assistLineWidth;
- this.textBox9.Text = this.trackBar7.Value.ToString();
- this.textBox3.Text = parentDialog.scopeMarginLeft/*this.trackBar7.Value*/.ToString();
- this.panel2.BackColor = this.parentDialog.rectLineColor;
- this.panel6.BackColor = this.parentDialog.baseLineColor;
- this.panel7.BackColor = this.parentDialog.scopeLineColor;
- this.panel3.BackColor = this.parentDialog.orgLineColor;
- this.panel1.BackColor = this.parentDialog.rect1LineColor;
- this.panel8.BackColor = this.parentDialog.rect2LineColor;
- this.panel9.BackColor = this.parentDialog.rect3LineColor;
- this.panel4.BackColor = this.parentDialog.assistLineColor;
- }
- private void InitializeLanguageText()
- {
- this.groupBox1.Text = PdnResources.GetString("Menu.operation.text");
- this.button10.Text = PdnResources.GetString("Menu.File.Close.Text");
- this.button2.Text = PdnResources.GetString("CommonAction.Save");
- this.groupBox3.Text = PdnResources.GetString("Menu.Preview.text");
- this.groupBox5.Text = "轮廓线设置";
- this.label15.Text = "轮廓线颜色" + ":";
- this.label7.Text = "轮廓线线宽" + ":";
- this.groupBox6.Text = "区域线设置";// PdnResources.GetString("Menu.Organizationlinesettings.text");
- this.label13.Text = PdnResources.GetString("Menu.realinewidth.Text") + ":";
- this.label14.Text = PdnResources.GetString("Menu.realinewcolor.Text") + ":";
- this.label11.Text = PdnResources.GetString("Menu.realin2ewcolor.Text") + ":";
- this.label12.Text = PdnResources.GetString("Menu.realin2ss.Text") + ":";
- this.label3.Text = PdnResources.GetString("Menu.Linewidthofarea1.text") + ":";
- this.label5.Text = PdnResources.GetString("Menu.Linecolorofarea1.text") + ":";
- this.label4.Text = PdnResources.GetString("Menu.Organizationlinewidth.text") + ":";
- this.label6.Text = PdnResources.GetString("Menu.Organizationlinecolor.text") + ":";
- this.groupBox2.Text = PdnResources.GetString("Menu.Baselinesettings.text");
- this.label8.Text = PdnResources.GetString("Menu.Baselinewidth.text") + ":";
- this.label9.Text = PdnResources.GetString("Menu.Baselinecolor.text") + ":";
- this.groupBox4.Text = PdnResources.GetString("Menu.Rangesetting.text");
- this.label10.Text = PdnResources.GetString("Menu.Distancefromtherangelinetotheboundary.text") + ":";
- this.label16.Text = PdnResources.GetString("Menu.Rangelinewidth.text") + ":";
- this.label18.Text = PdnResources.GetString("Menu.Rangelinecolor.text") + ":";
- this.groupBox7.Text = PdnResources.GetString("Menu.Auxiliarylinesettings.text");
- this.label1.Text = PdnResources.GetString("Menu.Auxiliarylinewidth.text") + ":";
- this.label2.Text = PdnResources.GetString("Menu.Auxiliarylinecolor.text") + ":";
- this.Text = PdnResources.GetString("Menu.Organizationdefinesmoresettings.text");
- }
- private void InitializeComponent()
- {
- this.components = new System.ComponentModel.Container();
- this.groupBox1 = new System.Windows.Forms.GroupBox();
- this.button10 = new System.Windows.Forms.Button();
- this.button2 = new System.Windows.Forms.Button();
- this.imageList1 = new System.Windows.Forms.ImageList(this.components);
- this.groupBox3 = new System.Windows.Forms.GroupBox();
- this.groupBox6 = new System.Windows.Forms.GroupBox();
- this.panel9 = new System.Windows.Forms.Panel();
- this.trackBar6 = new System.Windows.Forms.TrackBar();
- this.textBox6 = new System.Windows.Forms.TextBox();
- this.label13 = new System.Windows.Forms.Label();
- this.label14 = new System.Windows.Forms.Label();
- this.panel8 = new System.Windows.Forms.Panel();
- this.trackBar5 = new System.Windows.Forms.TrackBar();
- this.textBox4 = new System.Windows.Forms.TextBox();
- this.label11 = new System.Windows.Forms.Label();
- this.label12 = new System.Windows.Forms.Label();
- this.panel1 = new System.Windows.Forms.Panel();
- this.trackBar2 = new System.Windows.Forms.TrackBar();
- this.textBox2 = new System.Windows.Forms.TextBox();
- this.label3 = new System.Windows.Forms.Label();
- this.label5 = new System.Windows.Forms.Label();
- this.panel3 = new System.Windows.Forms.Panel();
- this.trackBar4 = new System.Windows.Forms.TrackBar();
- this.textBox10 = new System.Windows.Forms.TextBox();
- this.label4 = new System.Windows.Forms.Label();
- this.label6 = new System.Windows.Forms.Label();
- this.groupBox2 = new System.Windows.Forms.GroupBox();
- this.panel6 = new System.Windows.Forms.Panel();
- this.trackBar1 = new System.Windows.Forms.TrackBar();
- this.textBox1 = new System.Windows.Forms.TextBox();
- this.label8 = new System.Windows.Forms.Label();
- this.label9 = new System.Windows.Forms.Label();
- this.groupBox4 = new System.Windows.Forms.GroupBox();
- this.panel7 = new System.Windows.Forms.Panel();
- this.textBox3 = new System.Windows.Forms.TextBox();
- this.trackBar3 = new System.Windows.Forms.TrackBar();
- this.textBox5 = new System.Windows.Forms.TextBox();
- this.label10 = new System.Windows.Forms.Label();
- this.label16 = new System.Windows.Forms.Label();
- this.label18 = new System.Windows.Forms.Label();
- this.groupBox7 = new System.Windows.Forms.GroupBox();
- this.panel4 = new System.Windows.Forms.Panel();
- this.trackBar7 = new System.Windows.Forms.TrackBar();
- this.textBox9 = new System.Windows.Forms.TextBox();
- this.label1 = new System.Windows.Forms.Label();
- this.label2 = new System.Windows.Forms.Label();
- this.groupBox5 = new System.Windows.Forms.GroupBox();
- this.panel2 = new System.Windows.Forms.Panel();
- this.trackBar8 = new System.Windows.Forms.TrackBar();
- this.textBox7 = new System.Windows.Forms.TextBox();
- this.label7 = new System.Windows.Forms.Label();
- this.label15 = new System.Windows.Forms.Label();
- this.groupBox1.SuspendLayout();
- this.groupBox6.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.trackBar6)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.trackBar5)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.trackBar2)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.trackBar4)).BeginInit();
- this.groupBox2.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.trackBar1)).BeginInit();
- this.groupBox4.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.trackBar3)).BeginInit();
- this.groupBox7.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.trackBar7)).BeginInit();
- this.groupBox5.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.trackBar8)).BeginInit();
- this.SuspendLayout();
- //
- // groupBox1
- //
- this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.groupBox1.Controls.Add(this.button10);
- this.groupBox1.Controls.Add(this.button2);
- this.groupBox1.Location = new System.Drawing.Point(14, 3);
- this.groupBox1.Name = "groupBox1";
- this.groupBox1.Size = new System.Drawing.Size(847, 50);
- this.groupBox1.TabIndex = 1;
- this.groupBox1.TabStop = false;
- //
- // button10
- //
- this.button10.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.button10.Location = new System.Drawing.Point(661, 14);
- this.button10.Name = "button10";
- this.button10.Size = new System.Drawing.Size(84, 30);
- this.button10.TabIndex = 3;
- this.button10.UseVisualStyleBackColor = true;
- this.button10.Click += new System.EventHandler(this.button10_Click);
- //
- // button2
- //
- this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.button2.Location = new System.Drawing.Point(751, 14);
- this.button2.Name = "button2";
- this.button2.Size = new System.Drawing.Size(84, 30);
- this.button2.TabIndex = 2;
- this.button2.UseVisualStyleBackColor = true;
- this.button2.Click += new System.EventHandler(this.button2_Click);
- //
- // imageList1
- //
- this.imageList1.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
- this.imageList1.ImageSize = new System.Drawing.Size(64, 64);
- this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
- //
- // groupBox3
- //
- this.groupBox3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.groupBox3.Location = new System.Drawing.Point(387, 60);
- this.groupBox3.Name = "groupBox3";
- this.groupBox3.Size = new System.Drawing.Size(475, 385);
- this.groupBox3.TabIndex = 3;
- this.groupBox3.TabStop = false;
- //
- // groupBox6
- //
- this.groupBox6.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.groupBox6.Controls.Add(this.panel9);
- this.groupBox6.Controls.Add(this.trackBar6);
- this.groupBox6.Controls.Add(this.textBox6);
- this.groupBox6.Controls.Add(this.label13);
- this.groupBox6.Controls.Add(this.label14);
- this.groupBox6.Controls.Add(this.panel8);
- this.groupBox6.Controls.Add(this.trackBar5);
- this.groupBox6.Controls.Add(this.textBox4);
- this.groupBox6.Controls.Add(this.label11);
- this.groupBox6.Controls.Add(this.label12);
- this.groupBox6.Controls.Add(this.panel1);
- this.groupBox6.Controls.Add(this.trackBar2);
- this.groupBox6.Controls.Add(this.textBox2);
- this.groupBox6.Controls.Add(this.label3);
- this.groupBox6.Controls.Add(this.label5);
- this.groupBox6.Controls.Add(this.panel3);
- this.groupBox6.Controls.Add(this.trackBar4);
- this.groupBox6.Controls.Add(this.textBox10);
- this.groupBox6.Controls.Add(this.label4);
- this.groupBox6.Controls.Add(this.label6);
- this.groupBox6.Location = new System.Drawing.Point(14, 202);
- this.groupBox6.Name = "groupBox6";
- this.groupBox6.Size = new System.Drawing.Size(353, 122);
- this.groupBox6.TabIndex = 15;
- this.groupBox6.TabStop = false;
- //
- // panel9
- //
- this.panel9.BackColor = System.Drawing.Color.DarkSeaGreen;
- this.panel9.Location = new System.Drawing.Point(104, 93);
- this.panel9.Name = "panel9";
- this.panel9.Size = new System.Drawing.Size(40, 21);
- this.panel9.TabIndex = 37;
- this.panel9.Click += new System.EventHandler(this.panel6_Click);
- //
- // trackBar6
- //
- this.trackBar6.AutoSize = false;
- this.trackBar6.Cursor = System.Windows.Forms.Cursors.Hand;
- this.trackBar6.Location = new System.Drawing.Point(227, 94);
- this.trackBar6.Maximum = 50;
- this.trackBar6.Minimum = 1;
- this.trackBar6.Name = "trackBar6";
- this.trackBar6.Size = new System.Drawing.Size(71, 21);
- this.trackBar6.TabIndex = 36;
- this.trackBar6.TickStyle = System.Windows.Forms.TickStyle.None;
- this.trackBar6.Value = 3;
- this.trackBar6.Scroll += new System.EventHandler(this.trackBar6_Scroll);
- //
- // textBox6
- //
- this.textBox6.Location = new System.Drawing.Point(304, 93);
- this.textBox6.Name = "textBox6";
- this.textBox6.Size = new System.Drawing.Size(35, 21);
- this.textBox6.TabIndex = 35;
- this.textBox6.Text = "3";
- this.textBox6.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBoxWidth_KeyPress);
- this.textBox6.KeyUp += new System.Windows.Forms.KeyEventHandler(this.textBox6_KeyUp);
- //
- // label13
- //
- this.label13.AutoSize = true;
- this.label13.Location = new System.Drawing.Point(150, 98);
- this.label13.Name = "label13";
- this.label13.Size = new System.Drawing.Size(0, 12);
- this.label13.TabIndex = 34;
- //
- // label14
- //
- this.label14.AutoSize = true;
- this.label14.Location = new System.Drawing.Point(15, 98);
- this.label14.Name = "label14";
- this.label14.Size = new System.Drawing.Size(0, 12);
- this.label14.TabIndex = 33;
- //
- // panel8
- //
- this.panel8.BackColor = System.Drawing.Color.YellowGreen;
- this.panel8.Location = new System.Drawing.Point(104, 68);
- this.panel8.Name = "panel8";
- this.panel8.Size = new System.Drawing.Size(40, 21);
- this.panel8.TabIndex = 32;
- this.panel8.Click += new System.EventHandler(this.panel6_Click);
- //
- // trackBar5
- //
- this.trackBar5.AutoSize = false;
- this.trackBar5.Cursor = System.Windows.Forms.Cursors.Hand;
- this.trackBar5.Location = new System.Drawing.Point(227, 69);
- this.trackBar5.Maximum = 50;
- this.trackBar5.Minimum = 1;
- this.trackBar5.Name = "trackBar5";
- this.trackBar5.Size = new System.Drawing.Size(71, 21);
- this.trackBar5.TabIndex = 31;
- this.trackBar5.TickStyle = System.Windows.Forms.TickStyle.None;
- this.trackBar5.Value = 3;
- this.trackBar5.Scroll += new System.EventHandler(this.trackBar5_Scroll);
- //
- // textBox4
- //
- this.textBox4.Location = new System.Drawing.Point(304, 68);
- this.textBox4.Name = "textBox4";
- this.textBox4.Size = new System.Drawing.Size(35, 21);
- this.textBox4.TabIndex = 30;
- this.textBox4.Text = "3";
- this.textBox4.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBoxWidth_KeyPress);
- this.textBox4.KeyUp += new System.Windows.Forms.KeyEventHandler(this.textBox4_KeyUp);
- //
- // label11
- //
- this.label11.AutoSize = true;
- this.label11.Location = new System.Drawing.Point(150, 73);
- this.label11.Name = "label11";
- this.label11.Size = new System.Drawing.Size(0, 12);
- this.label11.TabIndex = 29;
- //
- // label12
- //
- this.label12.AutoSize = true;
- this.label12.Location = new System.Drawing.Point(15, 73);
- this.label12.Name = "label12";
- this.label12.Size = new System.Drawing.Size(0, 12);
- this.label12.TabIndex = 28;
- //
- // panel1
- //
- this.panel1.BackColor = System.Drawing.Color.MediumSpringGreen;
- this.panel1.Location = new System.Drawing.Point(104, 43);
- this.panel1.Name = "panel1";
- this.panel1.Size = new System.Drawing.Size(40, 21);
- this.panel1.TabIndex = 27;
- this.panel1.Click += new System.EventHandler(this.panel6_Click);
- //
- // trackBar2
- //
- this.trackBar2.AutoSize = false;
- this.trackBar2.Cursor = System.Windows.Forms.Cursors.Hand;
- this.trackBar2.Location = new System.Drawing.Point(227, 44);
- this.trackBar2.Maximum = 50;
- this.trackBar2.Minimum = 1;
- this.trackBar2.Name = "trackBar2";
- this.trackBar2.Size = new System.Drawing.Size(71, 21);
- this.trackBar2.TabIndex = 26;
- this.trackBar2.TickStyle = System.Windows.Forms.TickStyle.None;
- this.trackBar2.Value = 3;
- this.trackBar2.Scroll += new System.EventHandler(this.trackBar2_Scroll);
- //
- // textBox2
- //
- this.textBox2.Location = new System.Drawing.Point(304, 43);
- this.textBox2.Name = "textBox2";
- this.textBox2.Size = new System.Drawing.Size(35, 21);
- this.textBox2.TabIndex = 25;
- this.textBox2.Text = "3";
- this.textBox2.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBoxWidth_KeyPress);
- this.textBox2.KeyUp += new System.Windows.Forms.KeyEventHandler(this.textBox2_KeyUp);
- //
- // label3
- //
- this.label3.AutoSize = true;
- this.label3.Location = new System.Drawing.Point(150, 48);
- this.label3.Name = "label3";
- this.label3.Size = new System.Drawing.Size(0, 12);
- this.label3.TabIndex = 24;
- //
- // label5
- //
- this.label5.AutoSize = true;
- this.label5.Location = new System.Drawing.Point(15, 48);
- this.label5.Name = "label5";
- this.label5.Size = new System.Drawing.Size(0, 12);
- this.label5.TabIndex = 23;
- //
- // panel3
- //
- this.panel3.BackColor = System.Drawing.Color.LightCoral;
- this.panel3.Location = new System.Drawing.Point(104, 19);
- this.panel3.Name = "panel3";
- this.panel3.Size = new System.Drawing.Size(40, 21);
- this.panel3.TabIndex = 22;
- this.panel3.Click += new System.EventHandler(this.panel6_Click);
- //
- // trackBar4
- //
- this.trackBar4.AutoSize = false;
- this.trackBar4.Cursor = System.Windows.Forms.Cursors.Hand;
- this.trackBar4.Location = new System.Drawing.Point(227, 20);
- this.trackBar4.Maximum = 50;
- this.trackBar4.Minimum = 1;
- this.trackBar4.Name = "trackBar4";
- this.trackBar4.Size = new System.Drawing.Size(71, 21);
- this.trackBar4.TabIndex = 7;
- this.trackBar4.TickStyle = System.Windows.Forms.TickStyle.None;
- this.trackBar4.Value = 3;
- this.trackBar4.Scroll += new System.EventHandler(this.trackBar4_Scroll);
- //
- // textBox10
- //
- this.textBox10.Location = new System.Drawing.Point(304, 19);
- this.textBox10.Name = "textBox10";
- this.textBox10.Size = new System.Drawing.Size(35, 21);
- this.textBox10.TabIndex = 6;
- this.textBox10.Text = "3";
- this.textBox10.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBoxWidth_KeyPress);
- this.textBox10.KeyUp += new System.Windows.Forms.KeyEventHandler(this.textBox10_KeyUp);
- //
- // label4
- //
- this.label4.AutoSize = true;
- this.label4.Location = new System.Drawing.Point(150, 24);
- this.label4.Name = "label4";
- this.label4.Size = new System.Drawing.Size(0, 12);
- this.label4.TabIndex = 2;
- //
- // label6
- //
- this.label6.AutoSize = true;
- this.label6.Location = new System.Drawing.Point(15, 24);
- this.label6.Name = "label6";
- this.label6.Size = new System.Drawing.Size(0, 12);
- this.label6.TabIndex = 0;
- //
- // groupBox2
- //
- this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.groupBox2.Controls.Add(this.panel6);
- this.groupBox2.Controls.Add(this.trackBar1);
- this.groupBox2.Controls.Add(this.textBox1);
- this.groupBox2.Controls.Add(this.label8);
- this.groupBox2.Controls.Add(this.label9);
- this.groupBox2.Location = new System.Drawing.Point(14, 393);
- this.groupBox2.Name = "groupBox2";
- this.groupBox2.Size = new System.Drawing.Size(353, 52);
- this.groupBox2.TabIndex = 22;
- this.groupBox2.TabStop = false;
- //
- // panel6
- //
- this.panel6.BackColor = System.Drawing.Color.Yellow;
- this.panel6.Location = new System.Drawing.Point(88, 18);
- this.panel6.Name = "panel6";
- this.panel6.Size = new System.Drawing.Size(45, 21);
- this.panel6.TabIndex = 22;
- this.panel6.Click += new System.EventHandler(this.panel6_Click);
- //
- // trackBar1
- //
- this.trackBar1.AutoSize = false;
- this.trackBar1.Cursor = System.Windows.Forms.Cursors.Hand;
- this.trackBar1.Location = new System.Drawing.Point(214, 20);
- this.trackBar1.Maximum = 50;
- this.trackBar1.Minimum = 1;
- this.trackBar1.Name = "trackBar1";
- this.trackBar1.Size = new System.Drawing.Size(84, 21);
- this.trackBar1.TabIndex = 7;
- this.trackBar1.TickStyle = System.Windows.Forms.TickStyle.None;
- this.trackBar1.Value = 3;
- this.trackBar1.Scroll += new System.EventHandler(this.trackBar1_Scroll);
- //
- // textBox1
- //
- this.textBox1.Location = new System.Drawing.Point(304, 19);
- this.textBox1.Name = "textBox1";
- this.textBox1.Size = new System.Drawing.Size(35, 21);
- this.textBox1.TabIndex = 6;
- this.textBox1.Text = "3";
- this.textBox1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBoxWidth_KeyPress);
- this.textBox1.KeyUp += new System.Windows.Forms.KeyEventHandler(this.textBox1_KeyUp);
- //
- // label8
- //
- this.label8.AutoSize = true;
- this.label8.Location = new System.Drawing.Point(151, 24);
- this.label8.Name = "label8";
- this.label8.Size = new System.Drawing.Size(0, 12);
- this.label8.TabIndex = 2;
- //
- // label9
- //
- this.label9.AutoSize = true;
- this.label9.Location = new System.Drawing.Point(15, 24);
- this.label9.Name = "label9";
- this.label9.Size = new System.Drawing.Size(0, 12);
- this.label9.TabIndex = 0;
- //
- // groupBox4
- //
- this.groupBox4.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.groupBox4.Controls.Add(this.panel7);
- this.groupBox4.Controls.Add(this.textBox3);
- this.groupBox4.Controls.Add(this.trackBar3);
- this.groupBox4.Controls.Add(this.textBox5);
- this.groupBox4.Controls.Add(this.label10);
- this.groupBox4.Controls.Add(this.label16);
- this.groupBox4.Controls.Add(this.label18);
- this.groupBox4.Location = new System.Drawing.Point(14, 117);
- this.groupBox4.Name = "groupBox4";
- this.groupBox4.Size = new System.Drawing.Size(353, 79);
- this.groupBox4.TabIndex = 23;
- this.groupBox4.TabStop = false;
- //
- // panel7
- //
- this.panel7.BackColor = System.Drawing.Color.Red;
- this.panel7.Location = new System.Drawing.Point(88, 19);
- this.panel7.Name = "panel7";
- this.panel7.Size = new System.Drawing.Size(45, 21);
- this.panel7.TabIndex = 23;
- this.panel7.Click += new System.EventHandler(this.panel6_Click);
- //
- // textBox3
- //
- this.textBox3.Location = new System.Drawing.Point(134, 47);
- this.textBox3.Name = "textBox3";
- this.textBox3.Size = new System.Drawing.Size(121, 21);
- this.textBox3.TabIndex = 8;
- this.textBox3.Text = "25";
- this.textBox3.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBoxWidth_KeyPress);
- this.textBox3.KeyUp += new System.Windows.Forms.KeyEventHandler(this.textBox3_KeyUp);
- //
- // trackBar3
- //
- this.trackBar3.AutoSize = false;
- this.trackBar3.Cursor = System.Windows.Forms.Cursors.Hand;
- this.trackBar3.Location = new System.Drawing.Point(214, 20);
- this.trackBar3.Maximum = 50;
- this.trackBar3.Minimum = 1;
- this.trackBar3.Name = "trackBar3";
- this.trackBar3.Size = new System.Drawing.Size(84, 21);
- this.trackBar3.TabIndex = 7;
- this.trackBar3.TickStyle = System.Windows.Forms.TickStyle.None;
- this.trackBar3.Value = 3;
- this.trackBar3.Scroll += new System.EventHandler(this.trackBar3_Scroll);
- //
- // textBox5
- //
- this.textBox5.Location = new System.Drawing.Point(304, 19);
- this.textBox5.Name = "textBox5";
- this.textBox5.Size = new System.Drawing.Size(35, 21);
- this.textBox5.TabIndex = 6;
- this.textBox5.Text = "3";
- this.textBox5.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBoxWidth_KeyPress);
- this.textBox5.KeyUp += new System.Windows.Forms.KeyEventHandler(this.textBox5_KeyUp);
- //
- // label10
- //
- this.label10.AutoSize = true;
- this.label10.Location = new System.Drawing.Point(15, 51);
- this.label10.Name = "label10";
- this.label10.Size = new System.Drawing.Size(0, 12);
- this.label10.TabIndex = 3;
- //
- // label16
- //
- this.label16.AutoSize = true;
- this.label16.Location = new System.Drawing.Point(139, 24);
- this.label16.Name = "label16";
- this.label16.Size = new System.Drawing.Size(0, 12);
- this.label16.TabIndex = 2;
- //
- // label18
- //
- this.label18.AutoSize = true;
- this.label18.Location = new System.Drawing.Point(15, 24);
- this.label18.Name = "label18";
- this.label18.Size = new System.Drawing.Size(0, 12);
- this.label18.TabIndex = 0;
- //
- // groupBox7
- //
- this.groupBox7.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.groupBox7.Controls.Add(this.panel4);
- this.groupBox7.Controls.Add(this.trackBar7);
- this.groupBox7.Controls.Add(this.textBox9);
- this.groupBox7.Controls.Add(this.label1);
- this.groupBox7.Controls.Add(this.label2);
- this.groupBox7.Location = new System.Drawing.Point(14, 331);
- this.groupBox7.Name = "groupBox7";
- this.groupBox7.Size = new System.Drawing.Size(353, 56);
- this.groupBox7.TabIndex = 24;
- this.groupBox7.TabStop = false;
- //
- // panel4
- //
- this.panel4.BackColor = System.Drawing.Color.ForestGreen;
- this.panel4.Location = new System.Drawing.Point(104, 19);
- this.panel4.Name = "panel4";
- this.panel4.Size = new System.Drawing.Size(40, 21);
- this.panel4.TabIndex = 23;
- this.panel4.Click += new System.EventHandler(this.panel6_Click);
- //
- // trackBar7
- //
- this.trackBar7.AutoSize = false;
- this.trackBar7.Cursor = System.Windows.Forms.Cursors.Hand;
- this.trackBar7.Location = new System.Drawing.Point(227, 20);
- this.trackBar7.Maximum = 50;
- this.trackBar7.Minimum = 1;
- this.trackBar7.Name = "trackBar7";
- this.trackBar7.Size = new System.Drawing.Size(71, 21);
- this.trackBar7.TabIndex = 7;
- this.trackBar7.TickStyle = System.Windows.Forms.TickStyle.None;
- this.trackBar7.Value = 3;
- this.trackBar7.Scroll += new System.EventHandler(this.trackBar7_Scroll);
- //
- // textBox9
- //
- this.textBox9.Location = new System.Drawing.Point(304, 19);
- this.textBox9.Name = "textBox9";
- this.textBox9.Size = new System.Drawing.Size(35, 21);
- this.textBox9.TabIndex = 6;
- this.textBox9.Text = "3";
- this.textBox9.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBoxWidth_KeyPress);
- this.textBox9.KeyUp += new System.Windows.Forms.KeyEventHandler(this.textBox9_KeyUp);
- //
- // label1
- //
- this.label1.AutoSize = true;
- this.label1.Location = new System.Drawing.Point(150, 24);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(0, 12);
- this.label1.TabIndex = 2;
- //
- // label2
- //
- this.label2.AutoSize = true;
- this.label2.Location = new System.Drawing.Point(15, 24);
- this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(0, 12);
- this.label2.TabIndex = 0;
- //
- // groupBox5
- //
- this.groupBox5.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.groupBox5.Controls.Add(this.panel2);
- this.groupBox5.Controls.Add(this.trackBar8);
- this.groupBox5.Controls.Add(this.textBox7);
- this.groupBox5.Controls.Add(this.label7);
- this.groupBox5.Controls.Add(this.label15);
- this.groupBox5.Location = new System.Drawing.Point(14, 59);
- this.groupBox5.Name = "groupBox5";
- this.groupBox5.Size = new System.Drawing.Size(353, 52);
- this.groupBox5.TabIndex = 23;
- this.groupBox5.TabStop = false;
- //
- // panel2
- //
- this.panel2.BackColor = System.Drawing.Color.IndianRed;
- this.panel2.Location = new System.Drawing.Point(88, 18);
- this.panel2.Name = "panel2";
- this.panel2.Size = new System.Drawing.Size(45, 21);
- this.panel2.TabIndex = 22;
- this.panel2.Click += new System.EventHandler(this.panel6_Click);
- //
- // trackBar8
- //
- this.trackBar8.AutoSize = false;
- this.trackBar8.Cursor = System.Windows.Forms.Cursors.Hand;
- this.trackBar8.Location = new System.Drawing.Point(214, 20);
- this.trackBar8.Maximum = 50;
- this.trackBar8.Minimum = 1;
- this.trackBar8.Name = "trackBar8";
- this.trackBar8.Size = new System.Drawing.Size(84, 21);
- this.trackBar8.TabIndex = 7;
- this.trackBar8.TickStyle = System.Windows.Forms.TickStyle.None;
- this.trackBar8.Value = 3;
- this.trackBar8.Scroll += new System.EventHandler(this.trackBar8_Scroll);
- //
- // textBox7
- //
- this.textBox7.Location = new System.Drawing.Point(304, 19);
- this.textBox7.Name = "textBox7";
- this.textBox7.Size = new System.Drawing.Size(35, 21);
- this.textBox7.TabIndex = 6;
- this.textBox7.Text = "3";
- this.textBox7.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBoxWidth_KeyPress);
- this.textBox7.KeyUp += new System.Windows.Forms.KeyEventHandler(this.textBox7_KeyUp);
- //
- // label7
- //
- this.label7.AutoSize = true;
- this.label7.Location = new System.Drawing.Point(151, 24);
- this.label7.Name = "label7";
- this.label7.Size = new System.Drawing.Size(0, 12);
- this.label7.TabIndex = 2;
- //
- // label15
- //
- this.label15.AutoSize = true;
- this.label15.Location = new System.Drawing.Point(15, 24);
- this.label15.Name = "label15";
- this.label15.Size = new System.Drawing.Size(0, 12);
- this.label15.TabIndex = 0;
- //
- // TABMethod4DialogSetting
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
- this.ClientSize = new System.Drawing.Size(874, 457);
- this.Controls.Add(this.groupBox5);
- this.Controls.Add(this.groupBox7);
- this.Controls.Add(this.groupBox4);
- this.Controls.Add(this.groupBox2);
- this.Controls.Add(this.groupBox6);
- this.Controls.Add(this.groupBox3);
- this.Controls.Add(this.groupBox1);
- this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
- this.MaximizeBox = false;
- this.MinimizeBox = false;
- this.Name = "TABMethod4DialogSetting";
- this.Controls.SetChildIndex(this.groupBox1, 0);
- this.Controls.SetChildIndex(this.groupBox3, 0);
- this.Controls.SetChildIndex(this.groupBox6, 0);
- this.Controls.SetChildIndex(this.groupBox2, 0);
- this.Controls.SetChildIndex(this.groupBox4, 0);
- this.Controls.SetChildIndex(this.groupBox7, 0);
- this.Controls.SetChildIndex(this.groupBox5, 0);
- this.groupBox1.ResumeLayout(false);
- this.groupBox6.ResumeLayout(false);
- this.groupBox6.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.trackBar6)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.trackBar5)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.trackBar2)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.trackBar4)).EndInit();
- this.groupBox2.ResumeLayout(false);
- this.groupBox2.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.trackBar1)).EndInit();
- this.groupBox4.ResumeLayout(false);
- this.groupBox4.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.trackBar3)).EndInit();
- this.groupBox7.ResumeLayout(false);
- this.groupBox7.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.trackBar7)).EndInit();
- this.groupBox5.ResumeLayout(false);
- this.groupBox5.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.trackBar8)).EndInit();
- this.ResumeLayout(false);
- }
- /// <summary>
- /// 初始化其他控件
- /// </summary>
- private void InitOtherTools()
- {
- //
- //初始化图像控件
- //
- this.documentWorkspace = new DocumentWorkspaceWindow(this.appWorkspace);
- this.documentWorkspace.Dock = DockStyle.Fill;
- this.documentWorkspace.HookMouseEvents();
- this.documentWorkspace.AuxiliaryLineEnabled = false;
- this.documentWorkspace.Visible = false;
- this.documentWorkspace.activeTool = Annotation.Enum.DrawToolType.NullTool;
- this.groupBox3.Controls.Add(documentWorkspace);
- //
- //初始化操作按钮
- //
- this.commonControlButtons = new CommonControlButtons();
- this.commonControlButtons.Dock = DockStyle.Top;
- this.commonControlButtons.Height = 30;
- this.commonControlButtons.HideZoomToWindowAndActualSize();
- this.groupBox3.Controls.Add(commonControlButtons);
- //
- //调色板
- //
- this.colorsForm1 = new ColorsForm();
- this.colorsForm1.StartPosition = FormStartPosition.CenterScreen;
- this.colorsForm1.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged);
- this.colorsForm2 = new ColorsForm();
- this.colorsForm2.StartPosition = FormStartPosition.CenterScreen;
- this.colorsForm2.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged);
- this.colorsForm3 = new ColorsForm();
- this.colorsForm3.StartPosition = FormStartPosition.CenterScreen;
- this.colorsForm3.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged);
- this.colorsForm4 = new ColorsForm();
- this.colorsForm4.StartPosition = FormStartPosition.CenterScreen;
- this.colorsForm4.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged);
- this.colorsForm5 = new ColorsForm();
- this.colorsForm5.StartPosition = FormStartPosition.CenterScreen;
- this.colorsForm5.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged);
- ////
- ////滚动条与输入框值匹配
- ////
- //this.textBox1.Text = "" + this.trackBar1.Value;
- //this.textBox2.Text = "" + this.trackBar2.Value;
- }
- /// <summary>
- /// 初始化画布按键功能
- /// </summary>
- private void InitCommonButtonEvent()
- {
- this.commonControlButtons.zoomInButton.Click += new EventHandler(zoomInButton_Click);
- this.commonControlButtons.zoomOutButton.Click += new EventHandler(zoomOutButton_Click);
- this.commonControlButtons.zoomToWindowButton.Click += new EventHandler(zoomToWindowButton_Click);
- this.commonControlButtons.actualSizeButton.Click += new EventHandler(actualSizeButton_Click);
- this.commonControlButtons.pointerButton.Click += new EventHandler(pointerButton_Click);
- this.commonControlButtons.mobileModeButton.Click += new EventHandler(mobileModeButton_Click);
- }
- private void zoomInButton_Click(object sender, EventArgs e)
- {
- this.documentWorkspace.ZoomIn();
- }
- private void zoomOutButton_Click(object sender, EventArgs e)
- {
- this.documentWorkspace.ZoomOut();
- }
- private void zoomToWindowButton_Click(object sender, EventArgs e)
- {
- this.documentWorkspace.ZoomBasis = ZoomBasis.FitToWindow;
- }
- private void actualSizeButton_Click(object sender, EventArgs e)
- {
- this.documentWorkspace.ZoomBasis = ZoomBasis.ScaleFactor;
- this.documentWorkspace.ScaleFactor = ScaleFactor.OneToOne;
- }
- private void pointerButton_Click(object sender, EventArgs e)
- {
- this.documentWorkspace.ActiveTool = Annotation.Enum.DrawToolType.Pointer;
- }
- private void mobileModeButton_Click(object sender, EventArgs e)
- {
- this.documentWorkspace.ActiveTool = Annotation.Enum.DrawToolType.MoveMode;
- }
- /// <summary>
- /// 添加画布绑定事件
- /// </summary>
- private void AddPictureBoxEvent()
- {
- this.documentWorkspace.panel.MouseDown += new MouseEventHandler(this.BoxMouseDownHandler);
- this.documentWorkspace.panel.MouseMove += new MouseEventHandler(this.BoxMouseMoveHandler);
- this.documentWorkspace.panel.MouseUp += new MouseEventHandler(this.BoxMouseUpHandler);
- this.documentWorkspace.panel.Paint += new PaintEventHandler(this.BoxPaintHandler);
- }
- /// <summary>
- /// 调色板回调函数
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="ce"></param>
- private void colorsFormUserPrimaryColorChanged(object sender, ColorEventArgs ce)
- {
- }
- /// <summary>
- /// 添加内容单元格
- /// </summary>
- /// <param name="text"></param>
- /// <param name="tag"></param>
- /// <returns></returns>
- private DataGridViewTextBoxCell CreateTextBoxCell(string text, object tag)
- {
- DataGridViewTextBoxCell textboxcell = new DataGridViewTextBoxCell();
- textboxcell.Value = text;
- textboxcell.Tag = tag;
- return textboxcell;
- }
- /// <summary>
- /// 设置按钮
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button1_Click(object sender, EventArgs e)
- {
- AnalyzeSettingDialog metallographicMethodSetDialog = new AnalyzeSettingDialog(this, "Template.Manager.item3.MetallographicMethod");
- if (metallographicMethodSetDialog.hasModule)
- {
- metallographicMethodSetDialog.StartPosition = FormStartPosition.CenterScreen;
- metallographicMethodSetDialog.ShowDialog();
- }
- else
- {
- metallographicMethodSetDialog = null;
- }
- }
- /// <summary>
- /// 保存按钮
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button2_Click(object sender, EventArgs e)
- {
- this.parentDialog.rectLineWidth = this.trackBar8.Value;
- this.parentDialog.baseLineWidth = this.trackBar1.Value;
- this.parentDialog.scopeLineWidth = this.trackBar3.Value;
- this.parentDialog.orgLineWidth = this.trackBar4.Value;
- this.parentDialog.rect1LineWidth = this.trackBar2.Value;
- this.parentDialog.rect2LineWidth = this.trackBar5.Value;
- this.parentDialog.rect3LineWidth = this.trackBar6.Value;
- this.parentDialog.assistLineWidth = this.trackBar7.Value;
- int res = this.parentDialog.scopeMarginLeft;
- if (int.TryParse(this.textBox3.Text, out res))
- this.parentDialog.scopeMarginLeft = res;
- this.parentDialog.rectLineColor = this.panel2.BackColor;
- this.parentDialog.baseLineColor = this.panel6.BackColor;
- this.parentDialog.scopeLineColor = this.panel7.BackColor;
- this.parentDialog.orgLineColor = this.panel3.BackColor;
- this.parentDialog.rect1LineColor = this.panel1.BackColor;
- this.parentDialog.rect2LineColor = this.panel8.BackColor;
- this.parentDialog.rect3LineColor = this.panel9.BackColor;
- this.parentDialog.assistLineColor = this.panel4.BackColor;
- this.parentDialog.refreshWorkSpace();
- this.Close();
- }
- ///// <summary>
- ///// 限制只可以输入0-9数字以及退格键
- ///// </summary>
- ///// <param name="sender"></param>
- ///// <param name="e"></param>
- //private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
- //{
- // if (e.KeyChar != '\b')//这是允许输入退格键
- // {
- // int len = this.textBox1.Text.Length;
- // if (len < 1 && e.KeyChar == '0')
- // {
- // e.Handled = true;
- // }
- // else if ((e.KeyChar < '0') || (e.KeyChar > '9'))//这是允许输入0-9数字
- // {
- // e.Handled = true;
- // }
- // }
- //}
- ///// <summary>
- ///// 对输入值做限制
- ///// </summary>
- ///// <param name="sender"></param>
- ///// <param name="e"></param>
- //private void textBox1_KeyUp(object sender, KeyEventArgs e)
- //{
- // if (string.IsNullOrEmpty(this.textBox1.Text))
- // this.textBox1.Text = "1";
- // if (Convert.ToInt32(this.textBox1.Text) > 50)
- // this.textBox1.Text = "50";
- // this.trackBar1.Value = Convert.ToInt32(this.textBox1.Text);
- ////}
- ///// <summary>
- ///// 限制只可以输入0-9数字以及退格键
- ///// </summary>
- ///// <param name="sender"></param>
- ///// <param name="e"></param>
- //private void textBox2_KeyPress(object sender, KeyPressEventArgs e)
- //{
- // if (e.KeyChar != '\b')//这是允许输入退格键
- // {
- // int len = this.textBox1.Text.Length;
- // if (len < 1 && e.KeyChar == '0')
- // {
- // e.Handled = true;
- // }
- // else if ((e.KeyChar < '0') || (e.KeyChar > '9'))//这是允许输入0-9数字
- // {
- // e.Handled = true;
- // }
- // }
- //}
- ///// <summary>
- ///// 对输入值做限制
- ///// </summary>
- ///// <param name="sender"></param>
- ///// <param name="e"></param>
- //private void textBox2_KeyUp(object sender, KeyEventArgs e)
- //{
- // if (string.IsNullOrEmpty(this.textBox2.Text))
- // this.textBox2.Text = "1";
- // if (Convert.ToInt32(this.textBox2.Text) > 50)
- // this.textBox2.Text = "50";
- // this.trackBar2.Value = Convert.ToInt32(this.textBox2.Text);
- //}
- ///// <summary>
- ///// 基准线panel被点击
- ///// </summary>
- ///// <param name="sender"></param>
- ///// <param name="e"></param>
- //private void panel1_Click(object sender, EventArgs e)
- //{
- // this.colorsForm1.UserPrimaryColor = ColorBgra.FromColor(this.panel1.BackColor);
- // this.colorsForm1.setSaveBtn_Click(new System.EventHandler(this.colorsForm1Changed));
- // this.colorsForm1.ShowDialog();
- //}
- //private void colorsForm1Changed(object sender, EventArgs e)
- //{
- // this.panel1.BackColor = this.colorsForm1.UserPrimaryColor.ToColor();
- // this.colorsForm1.Close();
- // this.documentWorkspace.Refresh();
- //}
- ///// <summary>
- ///// 线长滚动条滚动事件
- ///// </summary>
- ///// <param name="sender"></param>
- ///// <param name="e"></param>
- //private void trackBar1_Scroll(object sender, EventArgs e)
- //{
- // this.textBox1.Text = "" + this.trackBar1.Value;
- //}
- //private void trackBar1_ValueChanged(object sender, EventArgs e)
- //{
- // this.documentWorkspace.Refresh();
- //}
- ///// <summary>
- ///// 线宽滚动条滚动事件
- ///// </summary>
- ///// <param name="sender"></param>
- ///// <param name="e"></param>
- //private void trackBar2_Scroll(object sender, EventArgs e)
- //{
- // this.textBox2.Text = "" + this.trackBar2.Value;
- //}
- //private void trackBar2_ValueChanged(object sender, EventArgs e)
- //{
- // this.documentWorkspace.Refresh();
- //}
- ///// <summary>
- ///// 完全脱碳层选择框选中事件
- ///// </summary>
- ///// <param name="sender"></param>
- ///// <param name="e"></param>
- //private void checkBox2_CheckedChanged(object sender, EventArgs e)
- //{
- // if(this.pointList.Count > 0)
- // {
- // if (this.checkBox2.Checked && this.checkBox3.Checked)
- // {
- // foreach(PointF[] pf in pointList)
- // {
- // pf[2] = new PointF((pf[0].X + pf[3].X) / 2f, (pf[0].Y + pf[3].Y) / 2f);
- // }
- // }
- // if (this.checkBox2.Checked && !this.checkBox3.Checked)
- // {
- // foreach (PointF[] pf in pointList)
- // {
- // pf[2] = new PointF((pf[0].X + pf[1].X) / 2f, (pf[0].Y + pf[1].Y) / 2f);
- // }
- // }
- // if (!this.checkBox2.Checked)
- // {
- // foreach (PointF[] pf in pointList)
- // {
- // pf[2] = PointF.Empty;
- // }
- // }
- // RefreshDataGridView1();
- // this.documentWorkspace.Refresh();
- // }
- //}
- ///// <summary>
- ///// 有效脱碳层选择框选中事件
- ///// </summary>
- ///// <param name="sender"></param>
- ///// <param name="e"></param>
- //private void checkBox3_CheckedChanged(object sender, EventArgs e)
- //{
- // if (this.pointList.Count > 0)
- // {
- // if (this.checkBox3.Checked && this.checkBox2.Checked)
- // {
- // foreach (PointF[] pf in pointList)
- // {
- // pf[3] = new PointF((pf[2].X + pf[1].X) / 2f, (pf[2].Y + pf[1].Y) / 2f);
- // }
- // }
- // if (this.checkBox3.Checked && !this.checkBox2.Checked)
- // {
- // foreach (PointF[] pf in pointList)
- // {
- // pf[3] = new PointF((pf[0].X + pf[1].X) / 2f, (pf[0].Y + pf[1].Y) / 2f);
- // }
- // }
- // if (!this.checkBox3.Checked)
- // {
- // foreach (PointF[] pf in pointList)
- // {
- // pf[3] = PointF.Empty;
- // }
- // }
- // RefreshDataGridView1();
- // this.documentWorkspace.Refresh();
- // }
- //}
- /// <summary>
- /// 鼠标按下
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void BoxMouseDownHandler(object sender, MouseEventArgs e)
- {
- if (operationK >= 0 && e.Button == MouseButtons.Left)
- {
- PointF downPoint = this.documentWorkspace.GetScalePoint(e.Location);
- if (operationK == 0)
- {
- startPoint = endPoint = downPoint;
- nowLine = new PointF[4];
- nowLine[0] = startPoint;
- nowLine[1] = endPoint;
- pointList.Add(nowLine);
- }
- else if (operationK == 1)
- {
- lastPoint.X = downPoint.X;
- lastPoint.Y = downPoint.Y;
- tempPoint.X = downPoint.X;
- tempPoint.Y = downPoint.Y;
- for (int i = rectangleFList.Count - 1; i >= 0; i--)
- {
- if (rectangleFList[i].Contains(downPoint))
- {
- selected = i;
- canMove = true;
- }
- }
- if(selected > -1)
- {
- if (new RectangleF(pointList[selected][0].X - 3, pointList[selected][0].Y - 3, 7, 7).Contains(downPoint))
- movePointIndex = 0;
- else if (new RectangleF(pointList[selected][1].X - 3, pointList[selected][1].Y - 3, 7, 7).Contains(downPoint))
- movePointIndex = 1;
- else if (pointList[selected][2] != PointF.Empty && new RectangleF(pointList[selected][2].X - 3, pointList[selected][2].Y - 3, 7, 7).Contains(downPoint))
- movePointIndex = 2;
- else if (pointList[selected][3] != PointF.Empty && new RectangleF(pointList[selected][3].X - 3, pointList[selected][3].Y - 3, 7, 7).Contains(downPoint))
- movePointIndex = 3;
- else
- movePointIndex = -1;
- }
- if (canMove)
- return;
- selected = -1;
- }
- }
- }
- /// <summary>
- /// 鼠标移动
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void BoxMouseMoveHandler(object sender, MouseEventArgs e)
- {
- this.documentWorkspace.panel.Cursor = Cursors.Default;
- if (operationK >= 0 && e.Button == MouseButtons.Left)
- {
- PointF movePoint = this.documentWorkspace.GetScalePoint(e.Location);
- //if (operationK == 0)
- //{
- // this.endPoint = movePoint;
- // pointList[lineCount][1] = endPoint;
- //}
- //else if (operationK == 1 && selected > -1 && canMove)
- //{
- // float dx = movePoint.X - lastPoint.X;
- // float dy = movePoint.Y - lastPoint.Y;
- // float dxTemp = movePoint.X - tempPoint.X;
- // float dyTemp = movePoint.Y - tempPoint.Y;
- // lastPoint.X = movePoint.X;
- // lastPoint.Y = movePoint.Y;
- // if (movePointIndex == -1)
- // {
- // RectangleF rectangleF = new RectangleF();
- // rectangleF = rectangleFList[selected];
- // if (rectangleF.Contains(movePoint))
- // this.documentWorkspace.panel.Cursor = Cursors.SizeAll;
- // rectangleF.X += dx;
- // rectangleF.Y += dy;
- // rectangleFList[selected] = rectangleF;
- // for (int i = 0; i < pointList[selected].Count(); i++)
- // {
- // pointList[selected][i].X += dx;
- // pointList[selected][i].Y += dy;
- // }
- // }
- // else if (movePointIndex == 0)
- // {
- // pointList[selected][0].X += dx;
- // pointList[selected][0].Y += dy;
- // if (checkBox2.Checked && checkBox3.Checked)
- // {
- // pointList[selected][2] = new PointF((2 * pointList[selected][0].X + pointList[selected][1].X) / 3f,
- // (2 * pointList[selected][0].Y + pointList[selected][1].Y) / 3f);
- // pointList[selected][3] = new PointF((pointList[selected][0].X + 2 * pointList[selected][1].X) / 3f,
- // (pointList[selected][0].Y + 2 * pointList[selected][1].Y) / 3f);
- // }
- // else if (checkBox2.Checked && !checkBox3.Checked)
- // {
- // pointList[selected][2] = new PointF((pointList[selected][0].X + pointList[selected][1].X) / 2f,
- // (pointList[selected][0].Y + pointList[selected][1].Y) / 2f);
- // pointList[selected][3] = PointF.Empty;
- // }
- // else if (!checkBox2.Checked && checkBox3.Checked)
- // {
- // pointList[selected][3] = new PointF((pointList[selected][0].X + pointList[selected][1].X) / 2f,
- // (pointList[selected][0].Y + pointList[selected][1].Y) / 2f);
- // pointList[selected][2] = PointF.Empty;
- // }
- // else
- // {
- // pointList[selected][2] = PointF.Empty;
- // pointList[selected][3] = PointF.Empty;
- // }
- // rectangleFList[selected] = CalcOtherRectangle(pointList[selected][0], pointList[selected][1]);
- // }
- // else if (movePointIndex == 1)
- // {
- // pointList[selected][1].X += dx;
- // pointList[selected][1].Y += dy;
-
- // if (checkBox2.Checked && checkBox3.Checked)
- // {
- // pointList[selected][2] = new PointF((2 * pointList[selected][0].X + pointList[selected][1].X) / 3f,
- // (2 * pointList[selected][0].Y + pointList[selected][1].Y) / 3f);
- // pointList[selected][3] = new PointF((pointList[selected][0].X + 2 * pointList[selected][1].X) / 3f,
- // (pointList[selected][0].Y + 2 * pointList[selected][1].Y) / 3f);
- // }
- // else if (checkBox2.Checked && !checkBox3.Checked)
- // {
- // pointList[selected][2] = new PointF((pointList[selected][0].X + pointList[selected][1].X) / 2f,
- // (pointList[selected][0].Y + pointList[selected][1].Y) / 2f);
- // pointList[selected][3] = PointF.Empty;
- // }
- // else if (!checkBox2.Checked && checkBox3.Checked)
- // {
- // pointList[selected][3] = new PointF((pointList[selected][0].X + pointList[selected][1].X) / 2f,
- // (pointList[selected][0].Y + pointList[selected][1].Y) / 2f);
- // pointList[selected][2] = PointF.Empty;
- // }
- // else
- // {
- // pointList[selected][2] = PointF.Empty;
- // pointList[selected][3] = PointF.Empty;
- // }
- // rectangleFList[selected] = CalcOtherRectangle(pointList[selected][0], pointList[selected][1]);
- // }
- // else if (movePointIndex == 2)
- // {
- // //测量线是一条垂线
- // if (pointList[selected][0].X == pointList[selected][1].X)
- // {
- // pointList[selected][2].Y += dy;
- // if (pointList[selected][3] == PointF.Empty)
- // pointList[selected][2].Y = FormatCoordinate(pointList[selected][0].Y, pointList[selected][1].Y, pointList[selected][2].Y);
- // else
- // pointList[selected][2].Y = FormatCoordinate(pointList[selected][0].Y, pointList[selected][3].Y, pointList[selected][2].Y);
- // }
- // //测量线是一条平行线
- // else if (pointList[selected][0].Y == pointList[selected][1].Y)
- // {
- // pointList[selected][2].X += dx;
- // if (pointList[selected][3] == PointF.Empty)
- // pointList[selected][2].X = FormatCoordinate(pointList[selected][0].X, pointList[selected][1].X, pointList[selected][2].X);
- // else
- // pointList[selected][2].X = FormatCoordinate(pointList[selected][0].X, pointList[selected][3].X, pointList[selected][2].X);
- // }
- // //其他情况
- // else
- // {
- // float k = (pointList[selected][1].Y - pointList[selected][0].Y) / (pointList[selected][1].X - pointList[selected][0].X);
- // float b = pointList[selected][0].Y - k * pointList[selected][0].X;
- // if (Math.Abs(dxTemp) >= Math.Abs(dyTemp))
- // {
- // pointList[selected][2].X += dx;
- // if (pointList[selected][3] == PointF.Empty)
- // pointList[selected][2].X = FormatCoordinate(pointList[selected][0].X, pointList[selected][1].X, pointList[selected][2].X);
- // else
- // pointList[selected][2].X = FormatCoordinate(pointList[selected][0].X, pointList[selected][3].X, pointList[selected][2].X);
- // pointList[selected][2].Y = k * pointList[selected][2].X + b;
- // }
- // else
- // {
- // pointList[selected][2].Y += dy;
- // if (pointList[selected][3] == PointF.Empty)
- // pointList[selected][2].Y = FormatCoordinate(pointList[selected][0].Y, pointList[selected][1].Y, pointList[selected][2].Y);
- // else
- // pointList[selected][2].Y = FormatCoordinate(pointList[selected][0].Y, pointList[selected][3].Y, pointList[selected][2].Y);
- // pointList[selected][2].X = (pointList[selected][2].Y - b) / k;
- // }
- // }
- // }
- // else if (movePointIndex == 3)
- // {
- // //测量线是一条垂线
- // if (pointList[selected][0].X == pointList[selected][1].X)
- // {
- // pointList[selected][3].Y += dy;
- // if (pointList[selected][2] == PointF.Empty)
- // pointList[selected][3].Y = FormatCoordinate(pointList[selected][0].Y, pointList[selected][1].Y, pointList[selected][3].Y);
- // else
- // pointList[selected][3].Y = FormatCoordinate(pointList[selected][2].Y, pointList[selected][1].Y, pointList[selected][3].Y);
- // }
- // //测量线是一条平行线
- // else if (pointList[selected][0].Y == pointList[selected][1].Y)
- // {
- // pointList[selected][3].X += dx;
- // if (pointList[selected][2] == PointF.Empty)
- // pointList[selected][3].X = FormatCoordinate(pointList[selected][0].X, pointList[selected][1].X, pointList[selected][3].X);
- // else
- // pointList[selected][3].X = FormatCoordinate(pointList[selected][2].X, pointList[selected][1].X, pointList[selected][3].X);
- // }
- // //其他情况
- // else
- // {
- // float k = (pointList[selected][1].Y - pointList[selected][0].Y) / (pointList[selected][1].X - pointList[selected][0].X);
- // float b = pointList[selected][0].Y - k * pointList[selected][0].X;
- // if (Math.Abs(dxTemp) >= Math.Abs(dyTemp))
- // {
- // pointList[selected][3].X += dx;
- // if (pointList[selected][2] == PointF.Empty)
- // pointList[selected][3].X = FormatCoordinate(pointList[selected][0].X, pointList[selected][1].X, pointList[selected][3].X);
- // else
- // pointList[selected][3].X = FormatCoordinate(pointList[selected][2].X, pointList[selected][1].X, pointList[selected][3].X);
- // pointList[selected][3].Y = k * pointList[selected][3].X + b;
- // }
- // else
- // {
- // pointList[selected][3].Y += dy;
- // if (pointList[selected][2] == PointF.Empty)
- // pointList[selected][3].Y = FormatCoordinate(pointList[selected][0].Y, pointList[selected][1].Y, pointList[selected][3].Y);
- // else
- // pointList[selected][3].Y = FormatCoordinate(pointList[selected][2].Y, pointList[selected][1].Y, pointList[selected][3].Y);
- // pointList[selected][3].X = (pointList[selected][3].Y - b) / k;
- // }
- // }
- // }
- //}
-
- //this.documentWorkspace.Refresh();
- }
- }
- /// <summary>
- /// 鼠标抬起
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void BoxMouseUpHandler(object sender, MouseEventArgs e)
- {
- if (operationK == 0)
- {
- //if (startPoint != null && endPoint != null && startPoint != endPoint)
- //{
- // if(checkBox2.Checked && checkBox3.Checked)
- // {
- // pointList[lineCount][2] = new PointF((2 * startPoint.X + endPoint.X) / 3f, (2 * startPoint.Y + endPoint.Y) / 3f);
- // pointList[lineCount][3] = new PointF((startPoint.X + 2 * endPoint.X) / 3f, (startPoint.Y + 2 * endPoint.Y) / 3f);
- // }
- // else if (checkBox2.Checked && !checkBox3.Checked)
- // {
- // pointList[lineCount][2] = new PointF((startPoint.X + endPoint.X) / 2f, (startPoint.Y + endPoint.Y) / 2f);
- // }
- // else if (!checkBox2.Checked && checkBox3.Checked)
- // {
- // pointList[lineCount][3] = new PointF((startPoint.X + endPoint.X) / 2f, (startPoint.Y + endPoint.Y) / 2f);
- // }
- // RectangleF rectangleF = CalcOtherRectangle(pointList[lineCount][0], pointList[lineCount][1]);
- // rectangleFList.Add(rectangleF);
- // lineCount++;
- // AddContentToDataGridView();
- //}
- //else
- //{
- // pointList.RemoveAt(pointList.Count - 1);
- //}
- //this.documentWorkspace.Refresh();
- }
- else if (operationK == 1)
- {
- //canMove = false;
- //movePointIndex = -1;
- //RefreshDataGridView1();
- }
- }
- /// <summary>
- /// 绘制事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void BoxPaintHandler(object sender, PaintEventArgs e)
- {
- if (this.documentWorkspace.CompositionSurface != null)
- {
- Rectangle rc = this.documentWorkspace.panel.ClientRectangle;
- int width = (int)(this.documentWorkspace.CompositionSurface.Width * this.documentWorkspace.ScaleFactor.Ratio);
- int height = (int)(this.documentWorkspace.CompositionSurface.Height * this.documentWorkspace.ScaleFactor.Ratio);
- int x = (rc.Width < width) ? this.documentWorkspace.panel.AutoScrollPosition.X : (rc.Width - width) / 2;
- int y = (rc.Height < height) ? this.documentWorkspace.panel.AutoScrollPosition.Y : (rc.Height - height) / 2;
- e.Graphics.TranslateTransform(x, y);
- e.Graphics.ScaleTransform((float)this.documentWorkspace.ScaleFactor.Ratio, (float)this.documentWorkspace.ScaleFactor.Ratio);
- Draw(e.Graphics);
- e.Graphics.ScaleTransform(1 / (float)this.documentWorkspace.ScaleFactor.Ratio, 1 / (float)this.documentWorkspace.ScaleFactor.Ratio);
- e.Graphics.TranslateTransform(-x, -y);
- }
- }
- /// <summary>
- /// 绘制
- /// </summary>
- private void Draw(Graphics graphics)
- {
- graphics.SmoothingMode = SmoothingMode.AntiAlias;
- //if (tempLine != null && tempLine.Length > 0 && !bcOriginChecked())
- //{
- // Pen lineColor = new Pen(this.rectLineColor, this.rectLineWidth);
- // for (int index = 0; index < tempLine.Length; index++)
- // {
- // System.Drawing.Point[] tempLine1 = tempLine[index];
- // graphics.DrawLines(lineColor, tempLine1);
- // }
- //}
- int margin = (int)(Convert.ToInt32(this.textBox3.Text) * 1200.0 / physical_width);// Math.Min(this.bitmap.Width / 2 - 5, this.bitmap.Width / 20/*(int)(this.scopeMarginLeft / this.physical_length)*/);// this.bitmap.Width / 20;
- margin = (int)(margin / this.physical_length);
- Line lineleft = new Line(new System.Drawing.Point(margin, 0), new System.Drawing.Point(margin, this.bitmap.Height));
- Line lineright = new Line(new System.Drawing.Point(this.bitmap.Width - margin, 0), new System.Drawing.Point(this.bitmap.Width - margin, this.bitmap.Height));
- //this.parentDialog.rectLineColor = this.panel2.BackColor;
- //this.parentDialog.baseLineColor = this.panel6.BackColor;
- //this.parentDialog.scopeLineColor = this.panel7.BackColor;
- //this.parentDialog.orgLineColor = this.panel3.BackColor;
- //this.parentDialog.rect1LineColor = this.panel1.BackColor;
- //this.parentDialog.rect2LineColor = this.panel8.BackColor;
- //this.parentDialog.rect3LineColor = this.panel9.BackColor;
- //this.parentDialog.assistLineColor = this.panel4.BackColor;
- if (lineleft != null)//line
- {
- graphics.DrawLine(new Pen(this.panel7.BackColor, this.trackBar3.Value), lineleft.startPoint, lineleft.endPoint);
- }
- if (lineright != null)//line
- {
- graphics.DrawLine(new Pen(this.panel7.BackColor, this.trackBar3.Value), lineright.startPoint, lineright.endPoint);
- }
- //this.parentDialog.rectLineWidth = this.trackBar8.Value;
- //this.parentDialog.baseLineWidth = this.trackBar1.Value;
- //this.parentDialog.scopeLineWidth = this.trackBar3.Value;
- //this.parentDialog.orgLineWidth = this.trackBar4.Value;
- //this.parentDialog.rect1LineWidth = this.trackBar2.Value;
- //this.parentDialog.rect2LineWidth = this.trackBar5.Value;
- //this.parentDialog.rect3LineWidth = this.trackBar6.Value;
- //this.parentDialog.assistLineWidth = this.trackBar7.Value;
- int planesnum = 50;// planesnumcal;// int.Parse(Intent.dict["planesnum"].ToString());
- int planesbottom = 50 + (int)(650/*600*/ / physical_length);// bottom.endPoint.Y;// int.Parse(Intent.dict["planesbottom"].ToString());
- //if (((planesbottom - planesnum) * physical_length) < 500)
- //{
- // this.drawLines();
- // MessageBox.Show(PdnResources.GetString("Menu.Thedistancebeselectagain.text"));
- // return;
- //}
- Line top = new Line(new System.Drawing.Point(0, planesnum), new System.Drawing.Point(this.bitmap.Width, planesnum));
- Line bottom = new Line(new System.Drawing.Point(0, planesbottom), new System.Drawing.Point(this.bitmap.Width, planesbottom));
- if (top != null && bottom != null)
- {
- //int planesnum = top.startPoint.Y;// int.Parse(Intent.dict["planesnum"].ToString());
- int planesbottom1 = planesnum + +(int)(200 / physical_length);
- int planesbottom2 = planesnum + +(int)(400 / physical_length);
- int planesbottom3 = bottom.startPoint.Y;// int.Parse(Intent.dict["planesbottom"].ToString());
- if (((bottom.startPoint.Y - planesnum) * physical_length) > 600)
- {
- planesbottom3 = planesnum + +(int)(600 / physical_length);
- }
- graphics.DrawLine(new Pen(this.panel1.BackColor, this.trackBar2.Value), new System.Drawing.Point(0, planesbottom1), new System.Drawing.Point(this.bitmap.Width, planesbottom1));
- graphics.DrawLine(new Pen(this.panel8.BackColor, this.trackBar5.Value), new System.Drawing.Point(0, planesbottom2), new System.Drawing.Point(this.bitmap.Width, planesbottom2));
- if (((bottom.startPoint.Y - planesnum) * physical_length) > 600)
- {
- graphics.DrawLine(new Pen(this.panel9.BackColor, this.trackBar6.Value), new System.Drawing.Point(0, planesbottom3), new System.Drawing.Point(this.bitmap.Width, planesbottom3));
- }
- graphics.DrawLine(new Pen(this.panel3.BackColor, this.trackBar4.Value), top.startPoint, top.endPoint);
- graphics.DrawLine(new Pen(this.panel6.BackColor, this.trackBar1.Value), bottom.startPoint, bottom.endPoint);
- }
- else if (bottom != null)
- {
- graphics.DrawLine(new Pen(this.panel6.BackColor, this.trackBar1.Value), bottom.startPoint, bottom.endPoint);
- }
- }
- /// <summary>
- /// 计算外接矩形
- /// </summary>
- private RectangleF CalcOtherRectangle(PointF p1, PointF p2)
- {
- RectangleF rectangleF = new RectangleF();
- if (p1.X > p2.X)
- rectangleF.X = p2.X;
- else
- rectangleF.X = p1.X;
- if (p1.Y > p2.Y)
- rectangleF.Y = p2.Y;
- else
- rectangleF.Y = p1.Y;
- rectangleF.Width = Math.Abs(p2.X - p1.X);
- rectangleF.Height = Math.Abs(p2.Y - p1.Y);
- return new RectangleF(rectangleF.X - 3, rectangleF.Y - 3, rectangleF.Width + 7, rectangleF.Height + 7);
- }
- ///// <summary>
- ///// 相颜色点击事件
- ///// </summary>
- ///// <param name="sender"></param>
- ///// <param name="e"></param>
- //private void panel6_Click(object sender, EventArgs e)
- //{
- // this.panelC = (Panel)sender;
- // this.colorsFormGrid.UserPrimaryColor = ColorBgra.FromColor(this.panel2.BackColor);
- // //this.colorsFormGrid.setSaveBtn_Click(new System.EventHandler(this.gridColorChanged));
- // this.colorsFormGrid.ShowDialog();
- //}
- /// <summary>
- /// PanelC的调色板颜色改变
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void gridColorChanged(object sender, EventArgs e)
- {
- Color color = this.colorsFormGrid.UserPrimaryColor.ToColor();
- //更改背景色,触发事件
- this.panelC.BackColor = color;
- //if (this.panelC == this.panel2)
- // this.parentDialog.rectLineColor = color;
- //else if (this.panelC == this.panel6)
- // this.parentDialog.baseLineColor = color;
- //else if (this.panelC == this.panel7)
- // this.parentDialog.scopeLineColor = color;
- //else if (this.panelC == this.panel3)
- // this.parentDialog.orgLineColor = color;
- //else if (this.panelC == this.panel1)
- // this.parentDialog.rect1LineColor = color;
- //else if (this.panelC == this.panel8)
- // this.parentDialog.rect2LineColor = color;
- //else if (this.panelC == this.panel9)
- // this.parentDialog.rect3LineColor = color;
- //else if (this.panelC == this.panel4)
- // this.parentDialog.assistLineColor = color;
- //this.parentDialog.refreshWorkSpace();
- this.documentWorkspace.Refresh();
- //关闭色板
- this.colorsFormGrid.Close();
- }
- private void textBox1_KeyUp(object sender, KeyEventArgs e)
- {
- this.varifyTextBoxValue(sender);
- this.trackBar1.Value = Convert.ToInt32(((TextBox)sender).Text);
- this.documentWorkspace.Refresh();
- }
- /// <summary>
- /// 线宽输入框 对输入值做限制
- /// </summary>
- /// <param name="sender"></param>
- private void varifyTextBoxValue(object sender)
- {
- if (string.IsNullOrEmpty(((TextBox)sender)/*this.textBox2*/.Text))
- ((TextBox)sender)/*this.textBox2*/.Text = "1";
- if (Convert.ToInt32(((TextBox)sender)/*this.textBox2*/.Text) > 50)
- ((TextBox)sender)/*this.textBox2*/.Text = "50";
- }
- private void textBox5_KeyUp(object sender, KeyEventArgs e)
- {
- this.varifyTextBoxValue(sender);
- this.trackBar3.Value = Convert.ToInt32(((TextBox)sender).Text);
- this.documentWorkspace.Refresh();
- }
- private void textBox10_KeyUp(object sender, KeyEventArgs e)
- {
- this.varifyTextBoxValue(sender);
- this.trackBar4.Value = Convert.ToInt32(((TextBox)sender).Text);
- this.documentWorkspace.Refresh();
- }
- private void textBox2_KeyUp(object sender, KeyEventArgs e)
- {
- this.varifyTextBoxValue(sender);
- this.trackBar2.Value = Convert.ToInt32(((TextBox)sender).Text);
- this.documentWorkspace.Refresh();
- }
- private void textBox4_KeyUp(object sender, KeyEventArgs e)
- {
- this.varifyTextBoxValue(sender);
- this.trackBar5.Value = Convert.ToInt32(((TextBox)sender).Text);
- this.documentWorkspace.Refresh();
- }
- private void textBox6_KeyUp(object sender, KeyEventArgs e)
- {
- this.varifyTextBoxValue(sender);
- this.trackBar6.Value = Convert.ToInt32(((TextBox)sender).Text);
- this.documentWorkspace.Refresh();
- }
- private void textBox9_KeyUp(object sender, KeyEventArgs e)
- {
- this.varifyTextBoxValue(sender);
- this.trackBar7.Value = Convert.ToInt32(((TextBox)sender).Text);
- this.documentWorkspace.Refresh();
- }
- private void textBox7_KeyUp(object sender, KeyEventArgs e)
- {
- this.varifyTextBoxValue(sender);
- this.trackBar8.Value = Convert.ToInt32(((TextBox)sender).Text);
- this.documentWorkspace.Refresh();
- }
- private void panel6_Click(object sender, EventArgs e)
- {
- this.panelC = (Panel)sender;
- this.colorsFormGrid.UserPrimaryColor = ColorBgra.FromColor(((Panel)sender).BackColor);
- this.colorsFormGrid.ShowDialog();
- }
- private void trackBar1_Scroll(object sender, EventArgs e)
- {
- this.textBox1.Text = "" + ((TrackBar)sender).Value;
- this.documentWorkspace.Refresh();
- }
- private void trackBar3_Scroll(object sender, EventArgs e)
- {
- this.textBox5.Text = "" + ((TrackBar)sender).Value;
- this.documentWorkspace.Refresh();
- }
- private void trackBar4_Scroll(object sender, EventArgs e)
- {
- this.textBox10.Text = "" + ((TrackBar)sender).Value;
- this.documentWorkspace.Refresh();
- }
- private void trackBar2_Scroll(object sender, EventArgs e)
- {
- this.textBox2.Text = "" + ((TrackBar)sender).Value;
- this.documentWorkspace.Refresh();
- }
- private void trackBar5_Scroll(object sender, EventArgs e)
- {
- this.textBox4.Text = "" + ((TrackBar)sender).Value;
- this.documentWorkspace.Refresh();
- }
- private void trackBar6_Scroll(object sender, EventArgs e)
- {
- this.textBox6.Text = "" + ((TrackBar)sender).Value;
- this.documentWorkspace.Refresh();
- }
- private void trackBar7_Scroll(object sender, EventArgs e)
- {
- this.textBox9.Text = "" + ((TrackBar)sender).Value;
- this.documentWorkspace.Refresh();
- }
- /// <summary>
- /// 关闭
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button10_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- private void textBox3_KeyUp(object sender, KeyEventArgs e)
- {
- if (string.IsNullOrEmpty(((TextBox)sender)/*this.textBox2*/.Text))
- ((TextBox)sender)/*this.textBox2*/.Text = "1";
- if (this.bitmap != null)
- {
- int maxMargin = (int)((this.physical_width/*bitmap.Width*/ / 2 - 5) * physical_length/*physical_length11*/);// Math.Min(this.bitmap.Width / 2 - 5, this.bitmap.Width / 20/*(int)(this.scopeMarginLeft / this.physical_length)*/);// this.bitmap.Width / 20;
- int margin;
- if (int.TryParse(((TextBox)sender)/*this.textBox2*/.Text, out margin) && margin > maxMargin)
- {
- ((TextBox)sender)/*this.textBox2*/.Text = maxMargin + "";
- }
- }
- else
- {
- if (Convert.ToInt32(((TextBox)sender)/*this.textBox2*/.Text) > 500)
- ((TextBox)sender)/*this.textBox2*/.Text = "500";
- }
- this.documentWorkspace.Refresh();
- }
- private void trackBar8_Scroll(object sender, EventArgs e)
- {
- this.textBox7.Text = "" + ((TrackBar)sender).Value;
- this.documentWorkspace.Refresh();
- }
- }
- }
|