12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249 |
- using OpenCvSharp;
- using PaintDotNet.Adjust;
- using PaintDotNet.Annotation;
- using PaintDotNet.Base.Functionodel;
- using PaintDotNet.CustomControl;
- using System;
- using System.Collections.Generic;
- using System.Drawing;
- using System.Drawing.Drawing2D;
- using System.Linq;
- using System.Windows.Forms;
- using Point = System.Drawing.Point;
- namespace PaintDotNet.DedicatedAnalysis.GrainSizeStandard.IntegrationClass
- {
- internal class GrainBoundaryEditingDialog : Form
- {
- public static string ParamKey_GrainApplygrainboundaries = "GrainApplygrainboundaries";//是否应用(计算晶界)
- public static string ParamKey_GrainAdOutParam0 = "GrainAdOutParam0";//方法1原方法,方法2模拟软件方法 this.radioButton1.Checked? 2 : 1;
- public static string ParamKey_GrainAdOutParam1 = "GrainAdOutParam1";//默认为暗晶界,为2时为亮晶界 this.radioButton3.Checked? 2 : 0;
- public static string ParamKey_GrainSigma = "GrainSigma";//西格玛 如果是高斯平滑,则指定高斯sigma,如果是方向平滑 则忽略此参数 double.TryParse(textBox6.Text, out sigma)
- public static string ParamKey_GrainDark = "GrainDark";//指定晶界类型,暗晶界dark=1, 否则dark=0, dark=2梯度 dark = this.comboBox2.SelectedIndex;
- public static string ParamKey_GrainSmooth_type = "GrainSmooth_type";//去噪类型: 高斯平滑: smooth_type=0; 方向平滑: smooth_type=1 smooth_type = this.comboBox3.SelectedIndex;
- public static string ParamKey_GrainEnhance = "GrainDisplaysections";//是否增强晶界?不增强:enhance=0; 增强: enhance=1 enhance = this.checkBox2.Checked? 1 : 0
- public static string ParamKey_GrainCell_size1 = "GrainCell_size1";//晶界大小
- public static string ParamKey_GrainCell_size2 = "GrainCell_size2";//晶界大小 cell_size = new double[2] { (double) numericUpDown1.Value, (double) numericUpDown2.Value }
- /// <summary>
- /// 调色板
- /// </summary>
- private ColorsForm colorsFormGrid;
- private Panel panelC;
- /// <summary>
- /// 公共按钮
- /// </summary>
- private CommonControlButtons commonControlButtons;
- /// <summary>
- /// 主控件
- /// </summary>
- private AppWorkspace appWorkspace;
- private DocumentWorkspaceWindow documentWorkspace;
- /// <summary>
- /// 存在视场标记
- /// </summary>
- private bool existViewFlag = false;
- /// <summary>
- /// 选中图片的mat
- /// </summary>
- private Mat imageMat;
- /// <summary>
- /// 用于get处理后的图像
- /// </summary>
- private Mat phaseMat;
- /// <summary>
- /// 用于get处理后的图像的颜色
- /// </summary>
- private Color phaseColor;
- private int menuId;
- /// <summary>
- /// 是否显示视场
- /// </summary>
- Boolean ShowDrawClassView = false;
- /// <summary>
- /// 起始点
- /// </summary>
- private Point startPoint = new Point(-1, -1);
- /// <summary>
- /// 是否绘制了起始点
- /// </summary>
- private bool drawedStartPoint = false;
- /// <summary>
- /// 结束点
- /// </summary>
- private Point endPoint = new Point(-1, -1);
- //1013###19326 晶粒度的晶界编辑页面,需要把辅助线带过去(客户编辑只处理辅助线位置的晶界)
- /// <summary>
- /// 辅助线集成 20720 【专用分析-晶粒度】4290-仲裁法,晶界重现后,在晶界编辑页面没有把网格带过去
- /// </summary>
- private GrainSize.GuideSizeArLawClass guide2Class;
- /// <summary>
- /// 辅助线集成
- /// </summary>
- private GrainSizeGuideClass guideClass;
- public object SelectedItem;
- /// <summary>
- /// 操作类型
- /// 0,没有操作 1,折线添加 2,直线添加
- /// 11,多边形删除 12,圆形删除 13,矩形删除 14,椭圆删除
- /// </summary>
- private int pointKtype = 0;
- /// <summary>
- /// 折线点的集合
- /// </summary>
- public List<PointF> pointFloatArray = new List<PointF>();
- /// <summary>
- /// 外接矩形,或者是计算的矩形
- /// </summary>
- protected RectangleF rectangle = new RectangleF(/*pointFloatArray 0, 1,,,, 2, 3*/);
- #region 实现撤销、恢复、重置的功能
- /// <summary>
- /// 当前操作在OperationsList的位置,用于判断是否可以撤销、恢复、重置
- /// </summary>
- private int OperationIndex = -1;
- /// <summary>
- /// 将 操作类型的集合放入一个List,通过OperationIndex读取当前操作位置
- /// </summary>
- private List<int> OperationKtypeList = new List<int>();
- /// <summary>
- /// 将 折线(/直线)点的集合(/外接矩形的xywh)放入一个List,通过OperationIndex读取当前操作位置
- /// </summary>
- private List<PointF[]> OperationsList = new List<PointF[]>();
- /// <summary>
- /// 保存晶界重现运算的结果
- /// </summary>
- private Mat PhaseModel0MatCopy;
- #endregion
- private GroupBox groupBox1;
- private GroupBox groupBox2;
- private GroupBox groupBox3;
- private Button button2;
- private Button button1;
- private Button button3;
- private Button button4;
- private Button button8;
- private Button button7;
- private Button button6;
- private Button button5;
- private Button button9;
- private GroupBox groupBox4;
- private Panel panel1;
- private Label label17;
- private GroupBox groupBox7;
- private GroupBox itemsGroupBox;
- private Button undoButton;
- private Button redoButton;
- private Button resetButton;
- private Panel panel2;
- private RadioButton applyRadioButton2;
- private RadioButton applyRadioButton1;
- private Label applyLabel;
- private Panel panel3;
- private RadioButton radioButton1;
- private RadioButton radioButton2;
- private Label label2;
- private Panel panel4;
- private RadioButton radioButton3;
- private RadioButton radioButton4;
- private Label label3;
- private Panel panel5;
- private Label label1;
- private Panel panel6;
- private TrackBar trackBar2;
- private Label label4;
- private TrackBar trackBar1;
- private Panel panel7;
- private RadioButton radioButton5;
- private RadioButton radioButton6;
- private Label label5;
- private Panel panel8;
- private TrackBar trackBar3;
- private Label label6;
- private RadioButton radioButton10;
- private RadioButton radioButton7;
- private RadioButton radioButton8;
- private Panel panel9;
- private RadioButton radioButton9;
- private RadioButton radioButton11;
- private Label label7;
- private int focusedItemIndex;
- /// <summary>
- /// 返回当前选择的图片内容
- /// </summary>
- /// <returns></returns>
- private DocumentWorkspace getCurrentWorkspace()
- {
- return this.appWorkspace.DocumentWorkspaces[focusedItemIndex];
- }
- public GrainSize.GuideSizeArLawClass Guide2Class
- {
- set
- {
- this.guide2Class = value;
- }
- }
- public GrainSizeGuideClass GuideClass
- {
- set
- {
- this.guideClass = value;
- }
- }
- /// <summary>
- /// PanelC的调色板颜色改变
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void gridColorChanged(object sender, EventArgs e)
- {
- Color color = this.colorsFormGrid.UserPrimaryColor.ToColor();
- ////更改背景色,触发事件
- //if (this.panelC != null)
- //{
- // this.panelC.BackColor = color;
- // //this.ColorPanelChanged(this.panelC);
- // this.panelC = null;
- // //关闭色板
- // this.colorsFormGrid.Close();
- // this.PhaseColor = this.panel1.BackColor;
- // return;
- //}
- //更改背景色,触发事件
- this.panel1.BackColor = color;
- this.documentWorkspace.PhaseModels[0].color = this.panel1.BackColor.ToArgb();
- this.PhaseColor = this.panel1.BackColor;
- this.runDectForColor();
- this.documentWorkspace.Refresh();
- //关闭色板
- this.colorsFormGrid.Close();
- }
- private Mat dstBinary = null;
- private Vec4b dstVec4b;
- private Vec4b dstVecBack4b;
- /// <summary>
- /// 颜色改变时改变相的颜色
- /// </summary>
- private unsafe void runDectForColor()
- {
- if (dstBinary != null)
- {
- dstBinary.Dispose();
- dstBinary = null;
- }
- if (this.documentWorkspace.PhaseModels[0].mat == null)
- return;
- dstVec4b = new Vec4b(this.PhaseColor.B, this.PhaseColor.G, this.PhaseColor.R, this.PhaseColor.A);
- dstVecBack4b = new Vec4b(this.PhaseColor.B, this.PhaseColor.G, this.PhaseColor.R, 0);
- dstBinary = this.documentWorkspace.PhaseModels[0].mat.Clone();// new Mat(this.documentWorkspace.PhaseModels[0].mat.Rows, this.documentWorkspace.PhaseModels[0].mat.Cols, MatType.CV_8UC1, new Scalar(0));
- //如果是rgba
- this.documentWorkspace.PhaseModels[0].mat.ForEachAsVec4b(ForeachFunctionByteForWhole4B);
- this.documentWorkspace.PhaseModels[0].mat = dstBinary.Clone();
- //Cv2.ImShow("dstBinary", dstBinary);
- //Cv2.WaitKey();
- this.documentWorkspace.Refresh();
- }
- /// <summary>
- /// 提取二值化的透明通道并赋值
- /// </summary>
- /// <param name="t"></param>
- /// <param name="position"></param>
- private unsafe void ForeachFunctionByteForWhole4B(Vec4b* t, int* position)
- {
- if (t->Item3 > 0)
- dstBinary.Set(position[0], position[1], dstVec4b);
- else
- dstBinary.Set(position[0], position[1], dstVecBack4b);
- }
- public GrainBoundaryEditingDialog(AppWorkspace appWorkspace, int menuId, int focusedItemIndex, Color phaseColor, Mat phaseMat, Boolean ShowDrawClassView = false)
- {
- this.menuId = menuId;
- this.ShowDrawClassView = ShowDrawClassView;
- this.focusedItemIndex = focusedItemIndex;
- this.appWorkspace = appWorkspace;
- this.colorsFormGrid = new ColorsForm();
- this.colorsFormGrid.StartPosition = FormStartPosition.CenterScreen;
- this.colorsFormGrid.setSaveBtn_Click(new System.EventHandler(this.gridColorChanged));
- InitializeComponent();
- InitializeLanguageText();
- //
- //初始化图像控件
- //
- this.documentWorkspace = new DocumentWorkspaceWindow(appWorkspace);
- this.documentWorkspace.Cursor = Cursors.Default;
- this.documentWorkspace.Dock = DockStyle.Fill;
- this.documentWorkspace.HookMouseEvents();
- this.documentWorkspace.AuxiliaryLineEnabled = false;
- this.documentWorkspace.Visible = false;
- this.documentWorkspace.panel.MouseDown += OnMouseDown;
- this.documentWorkspace.panel.Paint += Panel_Paint;
- this.documentWorkspace.panel.MouseMove += onMouseMove;
- this.documentWorkspace.panel.MouseUp += onMouseUp;
- this.documentWorkspace.ActiveTool = Annotation.Enum.DrawToolType.InclusionNoEffect;//禁止视场移动
- this.groupBox7.Controls.Add(documentWorkspace);
- //
- //初始化操作按钮
- //
- this.commonControlButtons = new CommonControlButtons();
- this.commonControlButtons.Dock = DockStyle.Top;
- this.commonControlButtons.Height = 30;
- this.commonControlButtons.HideZoomToWindowAndActualSize();
- this.groupBox7.Controls.Add(commonControlButtons);
- {
- //
- //初始化相
- //
- PhaseModel model = new PhaseModel();
- model.choise = true;
- model.mat = null;
- model.color = phaseColor.ToArgb();// Color.Green/*panel2.BackColor*/.ToArgb();
- model.position = this.documentWorkspace.PhaseModels.Count + 1;
- model.name = PdnResources.GetString("Menu.Grainboundarytoreproduce.text");
- this.documentWorkspace.PhaseModels.Add(model);
- }
- if (phaseMat != null)
- {
- this.documentWorkspace.PhaseModels[0].mat = phaseMat;
- PhaseModel0MatCopy = this.documentWorkspace.PhaseModels[0].mat.Clone();
- this.PhaseColor = phaseColor;
- }
- else
- this.PhaseColor = Color.Red;
- this.documentWorkspace.Refresh();
- existViewFlag = this.appWorkspace.DocumentWorkspaces[focusedItemIndex].GraphicsList.IsExsitView() && ShowDrawClassView;
- this.imageMat = this.appWorkspace.DocumentWorkspaces[focusedItemIndex].CompositionSurface.CreatedAliasedMat();
- Document document = Document.FromImageMat(imageMat.Clone());
- this.documentWorkspace.Document = document;
- this.documentWorkspace.Visible = true;
- if (ShowDrawClassView)
- {
- this.documentWorkspace.GraphicsList = this.appWorkspace.DocumentWorkspaces[focusedItemIndex].GraphicsList;
- }
- else
- {
- GraphicsList itemGraphicsList = this.appWorkspace.DocumentWorkspaces[focusedItemIndex].GraphicsList;
- GraphicsList graphicsList = new GraphicsList();
- for (int j = 0; j < itemGraphicsList.Count; j++)
- {
- if (itemGraphicsList[j].objectType != Annotation.Enum.DrawClass.View)
- graphicsList.Add(itemGraphicsList[j]);
- }
- this.documentWorkspace.GraphicsList = graphicsList;
- }
- InitCommonButtonEvent();
- }
- /// <summary>
- /// 添加操作数据到List集合中,并刷新操作按钮的状态
- /// </summary>
- /// <param name="addKtype"></param>
- /// <param name="pointFs"></param>
- private void AddOperationToList(int addKtype, PointF[] pointFs)
- {
- this.RefreshOperationsToIndex();
- this.OperationKtypeList.Add(addKtype);
- this.OperationsList.Add(pointFs);
- this.OperationIndex = this.OperationsList.Count - 1;
- this.RefreshOperationsButtons();
- }
- /// <summary>
- /// 根据OperationIndex去掉已经撤销的操作记录
- /// </summary>
- private void RefreshOperationsToIndex()
- {
- if (this.OperationIndex < this.OperationsList.Count - 1)
- {
- int operationSum = this.OperationsList.Count;
- for (int i = operationSum - 1; i > this.OperationIndex; i--)
- {
- this.OperationKtypeList.RemoveAt(i);
- this.OperationsList.RemoveAt(i);
- }
- }
- }
- /// <summary>
- /// 刷新操作按钮的状态
- /// </summary>
- private void RefreshOperationsButtons()
- {
- if (/*this.OperationIndex >= 0 && */this.OperationKtypeList.Count == this.OperationsList.Count && this.OperationKtypeList.Count > 0)
- this.resetButton.Enabled = true;
- else
- this.resetButton.Enabled = false;
- if (this.OperationIndex >= 0)
- this.undoButton.Enabled = true;
- else
- this.undoButton.Enabled = false;
- if (this.OperationIndex < this.OperationKtypeList.Count - 1)
- this.redoButton.Enabled = true;
- else
- this.redoButton.Enabled = false;
- }
- #region 矩形拖动
- /// <summary>
- /// 鼠标按下
- /// </summary>
- /// <param name="drawArea"></param>
- /// <param name="e"></param>
- private void OnMouseDown(object sender, MouseEventArgs e)
- {
- // 换算后的点
- PointF point1 = documentWorkspace.GetScalePoint(e.Location);
- if (point1.X <= this.documentWorkspace.CompositionSurface.Width
- && point1.X >= 0
- && point1.Y >= 0
- && point1.Y <= this.documentWorkspace.CompositionSurface.Height)
- {
- if (e.Button == MouseButtons.Left && this.pointKtype >= 1
- && !drawedStartPoint)
- drawedStartPoint = true;
- startPoint = new Point((int)point1.X, (int)point1.Y);
- }
- else if (this.pointKtype == 14 || this.pointKtype == 13 || this.pointKtype == 12)
- {
- if (!drawedStartPoint)//#21757
- {
- drawedStartPoint = true;
- startPoint = new Point((int)point1.X, (int)point1.Y);
- }
- }
- }
- /// <summary>
- /// 移动
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void onMouseMove(object sender, MouseEventArgs e)
- {
- // 换算后的点
- PointF point1 = documentWorkspace.GetScalePoint(e.Location);
- if (e.Button == MouseButtons.Left)
- {
- // 椭圆删除/圆形删除
- if ((this.pointKtype == 14 || this.pointKtype == 12) && drawedStartPoint)
- {
- endPoint = new Point((int)point1.X, (int)point1.Y);
- if (this.startPoint.X < this.endPoint.X)
- {
- //this.pointFloatArray.Clear();
- this.rectangle.X = this.startPoint.X;
- this.rectangle.Width = this.endPoint.X - this.startPoint.X;
- }
- else
- {
- this.rectangle.X = this.endPoint.X;
- this.rectangle.Width = this.startPoint.X - this.endPoint.X;
- }
- if (this.startPoint.Y < this.endPoint.Y)
- {
- this.rectangle.Y = this.startPoint.Y;
- this.rectangle.Height = this.endPoint.Y - this.startPoint.Y;
- }
- else
- {
- this.rectangle.Y = this.endPoint.Y;
- this.rectangle.Height = this.startPoint.Y - this.endPoint.Y;
- }
- this.documentWorkspace.Refresh();
- }
- // 矩形删除
- if (this.pointKtype == 13 && drawedStartPoint)
- {
- endPoint = new Point((int)point1.X, (int)point1.Y);
- if (this.startPoint.X < this.endPoint.X)
- {
- this.rectangle.X = this.startPoint.X;
- this.rectangle.Width = this.endPoint.X - this.startPoint.X;
- }
- else
- {
- this.rectangle.X = this.endPoint.X;
- this.rectangle.Width = this.startPoint.X - this.endPoint.X;
- }
- if (this.startPoint.Y < this.endPoint.Y)
- {
- this.rectangle.Y = this.startPoint.Y;
- this.rectangle.Height = this.endPoint.Y - this.startPoint.Y;
- }
- else
- {
- this.rectangle.Y = this.endPoint.Y;
- this.rectangle.Height = this.startPoint.Y - this.endPoint.Y;
- }
- this.documentWorkspace.Refresh();
- }
- // 直线添加
- if (this.pointKtype == 2 && drawedStartPoint)
- {
- endPoint = new Point((int)point1.X, (int)point1.Y);
- this.documentWorkspace.Refresh();
- }
- }
- }
- /// <summary>
- /// 鼠标抬起
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void onMouseUp(object sender, MouseEventArgs e)
- {
- // 换算后的点
- PointF point1 = documentWorkspace.GetScalePoint(e.Location);
- if (point1.X <= this.documentWorkspace.CompositionSurface.Width
- && point1.X >= 0
- && point1.Y >= 0
- && point1.Y <= this.documentWorkspace.CompositionSurface.Height) { }
- else
- {
- if (this.pointKtype == 14 || this.pointKtype == 13 || this.pointKtype == 12)//#21757
- {
- //if (point1.X >= this.documentWorkspace.CompositionSurface.Width)
- // point1.X = this.documentWorkspace.CompositionSurface.Width - 1;
- //if (point1.X < 0)
- // point1.X = 0;
- //if (point1.Y >= this.documentWorkspace.CompositionSurface.Height)
- // point1.Y = this.documentWorkspace.CompositionSurface.Height - 1;
- //if (point1.Y < 0)
- // point1.Y = 0;
- }
- else
- return;
- }
- if (e.Button == MouseButtons.Right)
- {
- // 折线删除
- if (this.pointKtype == 11 && pointFloatArray.Count > 1)
- {
- pointFloatArray.Add(new PointF(point1.X, point1.Y));
- endPoint = new Point((int)point1.X, (int)point1.Y);
- this.documentWorkspace.PhaseModels[0].mat = PreActionIntent.PolygonDelete(this.documentWorkspace.PhaseModels[0].mat, pointFloatArray);
- this.AddOperationToList(this.pointKtype, pointFloatArray.ToArray());
-
- this.rectangle.X = -1;
- this.rectangle.Y = -1;
- this.rectangle.Width = 0;
- this.rectangle.Height = 0;
- pointFloatArray.Clear();
- startPoint = new Point(-1, -1);
- drawedStartPoint = false;
- endPoint = new Point(-1, -1);
- this.pointKtype = 0;
- this.documentWorkspace.Refresh();
- }
- // 折线添加
- if (this.pointKtype == 1 && pointFloatArray.Count > 1)
- {
- pointFloatArray.Add(new PointF(point1.X, point1.Y));
- endPoint = new Point((int)point1.X, (int)point1.Y);
- //保存处理后的图片
- Bitmap originalBit = OpenCvSharp.Extensions.BitmapConverter.ToBitmap(this.documentWorkspace.PhaseModels[0].mat);
- Bitmap newBit = originalBit.Clone(new Rectangle(0, 0, originalBit.Width, originalBit.Height), originalBit.PixelFormat);
- Graphics graphics = Graphics.FromImage(newBit);
- Draw(graphics, false);
- this.documentWorkspace.PhaseModels[0].mat = PaintDotNet.Camera.Tools.ToMat(newBit);
- this.AddOperationToList(this.pointKtype, pointFloatArray.ToArray());
- pointFloatArray.Clear();
- startPoint = new Point(-1, -1);
- drawedStartPoint = false;
- endPoint = new Point(-1, -1);
- this.pointKtype = 0;
- this.documentWorkspace.Refresh();
- }
- }
- if (e.Button == MouseButtons.Left)
- {
- // 圆形删除/椭圆删除
- if ((this.pointKtype == 14 || this.pointKtype == 12) && drawedStartPoint)
- {
- endPoint = new Point((int)point1.X, (int)point1.Y);
- if (this.startPoint.X < this.endPoint.X)
- {
- this.rectangle.X = this.startPoint.X;
- this.rectangle.Width = this.endPoint.X - this.startPoint.X;
- }
- else
- {
- this.rectangle.X = this.endPoint.X;
- this.rectangle.Width = this.startPoint.X - this.endPoint.X;
- }
- if (this.startPoint.Y < this.endPoint.Y)
- {
- this.rectangle.Y = this.startPoint.Y;
- this.rectangle.Height = this.endPoint.Y - this.startPoint.Y;
- }
- else
- {
- this.rectangle.Y = this.endPoint.Y;
- this.rectangle.Height = this.startPoint.Y - this.endPoint.Y;
- }
- if (this.pointKtype == 14)
- this.documentWorkspace.PhaseModels[0].mat = PreActionIntent.OvalDelete(this.documentWorkspace.PhaseModels[0].mat, this.rectangle);
- else
- this.documentWorkspace.PhaseModels[0].mat = PreActionIntent.OvalDelete(this.documentWorkspace.PhaseModels[0].mat
- , new RectangleF(this.rectangle.X, this.rectangle.Y, Math.Min(this.rectangle.Width, this.rectangle.Height), Math.Min(this.rectangle.Width, this.rectangle.Height)));
- List<PointF> pointOperationArray = new List<PointF>();
- pointOperationArray.Add(new PointF(this.rectangle.X, this.rectangle.Y));
- pointOperationArray.Add(new PointF(this.rectangle.Width, this.rectangle.Height));
- this.AddOperationToList(this.pointKtype, pointOperationArray/*pointFloatArray*/.ToArray());
- this.rectangle.X = -1;
- this.rectangle.Y = -1;
- this.rectangle.Width = 0;
- this.rectangle.Height = 0;
- startPoint = new Point(-1, -1);
- drawedStartPoint = false;
- endPoint = new Point(-1, -1);
- this.pointKtype = 0;
- this.documentWorkspace.Refresh();
- }
- // 矩形删除
- if (this.pointKtype == 13 && drawedStartPoint)
- {
- endPoint = new Point((int)point1.X, (int)point1.Y);
- if (this.startPoint.X < this.endPoint.X)
- {
- this.rectangle.X = this.startPoint.X;
- this.rectangle.Width = this.endPoint.X - this.startPoint.X;
- }
- else
- {
- this.rectangle.X = this.endPoint.X;
- this.rectangle.Width = this.startPoint.X - this.endPoint.X;
- }
- if (this.startPoint.Y < this.endPoint.Y)
- {
- this.rectangle.Y = this.startPoint.Y;
- this.rectangle.Height = this.endPoint.Y - this.startPoint.Y;
- }
- else
- {
- this.rectangle.Y = this.endPoint.Y;
- this.rectangle.Height = this.startPoint.Y - this.endPoint.Y;
- }
- this.documentWorkspace.PhaseModels[0].mat = PreActionIntent.RectangleDelete(this.documentWorkspace.PhaseModels[0].mat, this.rectangle);
- List<PointF> pointOperationArray = new List<PointF>();
- pointOperationArray.Add(new PointF(this.rectangle.X, this.rectangle.Y));
- pointOperationArray.Add(new PointF(this.rectangle.Width, this.rectangle.Height));
- this.AddOperationToList(this.pointKtype, pointOperationArray/*pointFloatArray*/.ToArray());
- this.rectangle.X = -1;
- this.rectangle.Y = -1;
- this.rectangle.Width = 0;
- this.rectangle.Height = 0;
- startPoint = new Point(-1, -1);
- drawedStartPoint = false;
- endPoint = new Point(-1, -1);
- this.pointKtype = 0;
- this.documentWorkspace.Refresh();
- }
- // 折线添加/折线删除
- if (this.pointKtype == 1 || this.pointKtype == 11)
- {
- pointFloatArray.Add(new PointF(point1.X, point1.Y));
- if (drawedStartPoint)
- {
- }
- else
- startPoint = new Point((int)point1.X, (int)point1.Y);
- this.documentWorkspace.Refresh();
- }
- // 直线添加
- if (this.pointKtype == 2 && drawedStartPoint)
- {
- endPoint = new Point((int)point1.X, (int)point1.Y);
- //保存处理后的图片
- Bitmap originalBit = OpenCvSharp.Extensions.BitmapConverter.ToBitmap(this.documentWorkspace.PhaseModels[0].mat);
- Bitmap newBit = originalBit.Clone(new Rectangle(0, 0, originalBit.Width, originalBit.Height), originalBit.PixelFormat);
- Graphics graphics = Graphics.FromImage(newBit);
- Draw(graphics, false);
- this.documentWorkspace.PhaseModels[0].mat = PaintDotNet.Camera.Tools.ToMat(newBit);
- List<PointF> pointOperationArray = new List<PointF>();
- pointOperationArray.Add(new PointF(startPoint.X, startPoint.Y));
- pointOperationArray.Add(new PointF(endPoint.X, endPoint.Y));
- this.AddOperationToList(this.pointKtype, pointOperationArray/*pointFloatArray*/.ToArray());
- startPoint = new Point(-1, -1);
- drawedStartPoint = false;
- endPoint = new Point(-1, -1);
- this.pointKtype = 0;
- this.documentWorkspace.Refresh();
- }
- }
- }
- #endregion
- /// <summary>
- /// 画布绘制
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Panel_Paint(object sender, PaintEventArgs e)
- {
- if (this.documentWorkspace.CompositionSurface != null)
- {
- //
- // 以下是计算绘制图片的位置和大小并绘制图片
- //
- System.Drawing.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);
- //if (this.checkBox4_0.Checked)//显示网格
- Draw(e.Graphics, true);
- 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 g, bool DrawGuideLines)
- {
- // 抗锯齿
- g.SmoothingMode = SmoothingMode.AntiAlias;
- if (DrawGuideLines)
- {
- if (guideClass != null && guideClass.GrainSizeGuideAreaMethodModel != null)
- guideClass.DrawAreaGuide(g, SelectedItem, guideClass.guideModel);
- else if (guideClass != null && guideClass.GrainSizeGuideStyleModel != null)
- guideClass.DrawGuideLines(g, SelectedItem, guideClass.guideModel);
- }
- if (guide2Class != null && this.documentWorkspace.CompositionSurface != null)
- guide2Class.DrawGridViews(g, this.documentWorkspace.CompositionSurface.Height, this.documentWorkspace.CompositionSurface.Width);
-
- //圆形删除/椭圆删除
- if ((this.pointKtype == 14 || this.pointKtype == 12) && (this.rectangle.Width > 0 || this.rectangle.Height > 0))
- {
- Pen pen = new Pen(this.phaseColor, 1);
- pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot;
- if (this.pointKtype == 14)
- g.DrawEllipse(pen, this.rectangle);
- else
- g.DrawEllipse(pen, new RectangleF(this.rectangle.X, this.rectangle.Y, Math.Min(this.rectangle.Width, this.rectangle.Height), Math.Min(this.rectangle.Width, this.rectangle.Height)));
- pen.Dispose();
- }
- //矩形删除
- if (this.pointKtype == 13 && (this.rectangle.Width > 0 || this.rectangle.Height > 0))
- {
- Pen pen = new Pen(this.phaseColor, 1);
- pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot;
- g.DrawRectangle(pen, new Rectangle((int)this.rectangle.X, (int)this.rectangle.Y, (int)this.rectangle.Width, (int)this.rectangle.Height));
- pen.Dispose();
- }
- // 折线删除
- if (this.pointKtype == 11 && pointFloatArray.Count >= 2)
- {
- Pen pen = new Pen(this.phaseColor, 1);
- pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot;
- g.DrawPolygon(pen, pointFloatArray.ToArray());
- pen.Dispose();
- }
- // 直线添加
- if (this.pointKtype == 2 && /*pointFloatArray.Count == 2*/drawedStartPoint && this.endPoint.X > -1 && this.endPoint.Y > -1)
- {
- Pen pen = new Pen(this.phaseColor, 1);
- //g.DrawLine(pen, pointFloatArray[0].X, pointFloatArray[0].Y, pointFloatArray[1].X, pointFloatArray[1].Y);
- ////pen.DashStyle = DashStyle.Dash;
- g.DrawLine(pen, startPoint.X, startPoint.Y, endPoint.X, endPoint.Y);
- pen.Dispose();
- }
- // 折线添加
- if (this.pointKtype == 1 && pointFloatArray.Count >= 2)
- {
- Pen pen = new Pen(this.phaseColor, 1);
- g.DrawLines(pen, pointFloatArray.ToArray());
- pen.Dispose();
- }
- }
- private void InitializeLanguageText()
- {
- this.applyLabel.Text = PdnResources.GetString("Menu.IsItApplied.text") + ":";
- this.label2.Text = PdnResources.GetString("Menu.Method.text") + ":";
- this.label3.Text = PdnResources.GetString("Menu.Grainboundarytype.text") + ":";
- this.label17.Text = PdnResources.GetString("Menu.Phasecolor.text") + ":";
- this.label1.Text = PdnResources.GetString("Menu.GrainScale.text") + ":";
- this.label4.Text = PdnResources.GetString("Menu.GrainWidth.text") + ":";
- this.label5.Text = PdnResources.GetString("Menu.adjustment.text") + ":";
- this.label6.Text = PdnResources.GetString("Menu.intensity.text") + ":";
- this.label7.Text = PdnResources.GetString("Menu.linear.text") + ":";
- this.button3.Text = PdnResources.GetString("Menu.Grainboundaryedit.text");
- this.groupBox4.Text = PdnResources.GetString("Menu.params.text");// PdnResources.GetString("Menu.Grainboundarytoreproduce.text");
- //this.comboBox3.Items.AddRange(new object[] {
- //PdnResources.GetString("Menu.Gaussiansmoothing.text"),
- //PdnResources.GetString("Menu.directionalsmoothing.text")});
- //this.comboBox2.Items.AddRange(new object[] {
- //PdnResources.GetString("Menu.Brightgrainboundary.text"),
- //PdnResources.GetString("Menu.Darkgrainboundary.text"),
- //PdnResources.GetString("Menu.gradient.text")});
- this.resetButton.Text = PdnResources.GetString("Menu.reinformation.text");
- this.resetButton.Enabled = false;
- this.redoButton.Text = PdnResources.GetString("Menu.Edit.Redo.Text");
- this.redoButton.Enabled = false;
- this.undoButton.Text = PdnResources.GetString("CommonAction.Undo");
- this.undoButton.Enabled = false;
- this.groupBox1.Text = PdnResources.GetString("Menu.operation.text");
- this.button9.Text = PdnResources.GetString("CommonAction.Undo");
- this.button2.Text = PdnResources.GetString("Menu.application.text");// PdnResources.GetString("Menu.File.Close.Text");
- this.button1.Text = PdnResources.GetString("Form.OkButton.Text");
- this.groupBox2.Text = PdnResources.GetString("Menu.Addgrainboundaries.text");
- this.button4.Text = PdnResources.GetString("Menu.Lineadd.text");
- this.button3.Text = PdnResources.GetString("Menu.Polylineadd.text");
- this.groupBox3.Text = PdnResources.GetString("Menu.Deletegrainboundary.text");
- this.button8.Text = PdnResources.GetString("Menu.Ellipsedelete.text");
- this.button7.Text = PdnResources.GetString("Menu.BinaryAction.RectangleDelete.Text");
- this.button6.Text = PdnResources.GetString("Menu.rounddelete.text");
- this.button5.Text = PdnResources.GetString("Menu.BinaryAction.PolygonleDelete.Text");
- this.groupBox7.Text = PdnResources.GetString("Menu.Preview.text");
- this.Text = PdnResources.GetString("Menu.Grainboundarytoreproduce.text");// PdnResources.GetString("Menu.Grainboundaryedit.text");
- this.radioButton9.Text = PdnResources.GetString("Menu.Intercept.text");
- this.radioButton11.Text = PdnResources.GetString("Menu.Slope.text");
- this.radioButton10.Text = PdnResources.GetString("Menu.LinearTrim.text");
- this.radioButton7.Text = PdnResources.GetString("Menu.Bright.text");
- this.radioButton8.Text = PdnResources.GetString("Menu.Dimming.text");
- this.radioButton5.Text = PdnResources.GetString("Menu.auto-adjust.text");
- this.radioButton6.Text = PdnResources.GetString("Menu.NoAdjust.text");
- this.radioButton3.Text = PdnResources.GetString("Menu.Brightgrainboundary.text");
- this.radioButton4.Text = PdnResources.GetString("Menu.Darkgrainboundary.text");
- this.applyRadioButton2.Text = PdnResources.GetString("Menu.no.text");
- this.applyRadioButton1.Text = PdnResources.GetString("Menu.Yes.text");
- this.itemsGroupBox.Text = PdnResources.GetString("Menu.operation.text");
- //
- }
- private void InitializeComponent()
- {
- this.groupBox1 = new System.Windows.Forms.GroupBox();
- this.button9 = new System.Windows.Forms.Button();
- this.button2 = new System.Windows.Forms.Button();
- this.button1 = new System.Windows.Forms.Button();
- this.groupBox2 = new System.Windows.Forms.GroupBox();
- this.button4 = new System.Windows.Forms.Button();
- this.button3 = new System.Windows.Forms.Button();
- this.groupBox3 = new System.Windows.Forms.GroupBox();
- this.button8 = new System.Windows.Forms.Button();
- this.button7 = new System.Windows.Forms.Button();
- this.button6 = new System.Windows.Forms.Button();
- this.button5 = new System.Windows.Forms.Button();
- this.groupBox7 = new System.Windows.Forms.GroupBox();
- this.groupBox4 = new System.Windows.Forms.GroupBox();
- this.panel9 = new System.Windows.Forms.Panel();
- this.radioButton9 = new System.Windows.Forms.RadioButton();
- this.radioButton11 = new System.Windows.Forms.RadioButton();
- this.label7 = new System.Windows.Forms.Label();
- this.panel8 = new System.Windows.Forms.Panel();
- this.trackBar3 = new System.Windows.Forms.TrackBar();
- this.label6 = new System.Windows.Forms.Label();
- this.panel7 = new System.Windows.Forms.Panel();
- this.radioButton10 = new System.Windows.Forms.RadioButton();
- this.radioButton7 = new System.Windows.Forms.RadioButton();
- this.radioButton8 = new System.Windows.Forms.RadioButton();
- this.radioButton5 = new System.Windows.Forms.RadioButton();
- this.radioButton6 = new System.Windows.Forms.RadioButton();
- this.label5 = new System.Windows.Forms.Label();
- this.panel1 = new System.Windows.Forms.Panel();
- this.panel6 = new System.Windows.Forms.Panel();
- this.trackBar2 = new System.Windows.Forms.TrackBar();
- this.label4 = new System.Windows.Forms.Label();
- this.panel5 = new System.Windows.Forms.Panel();
- this.trackBar1 = new System.Windows.Forms.TrackBar();
- this.label1 = new System.Windows.Forms.Label();
- this.panel4 = new System.Windows.Forms.Panel();
- this.radioButton3 = new System.Windows.Forms.RadioButton();
- this.radioButton4 = new System.Windows.Forms.RadioButton();
- this.label3 = new System.Windows.Forms.Label();
- this.panel3 = new System.Windows.Forms.Panel();
- this.radioButton1 = new System.Windows.Forms.RadioButton();
- this.radioButton2 = new System.Windows.Forms.RadioButton();
- this.label2 = new System.Windows.Forms.Label();
- this.panel2 = new System.Windows.Forms.Panel();
- this.applyRadioButton2 = new System.Windows.Forms.RadioButton();
- this.applyRadioButton1 = new System.Windows.Forms.RadioButton();
- this.applyLabel = new System.Windows.Forms.Label();
- this.label17 = new System.Windows.Forms.Label();
- this.itemsGroupBox = new System.Windows.Forms.GroupBox();
- this.undoButton = new System.Windows.Forms.Button();
- this.redoButton = new System.Windows.Forms.Button();
- this.resetButton = new System.Windows.Forms.Button();
- this.groupBox1.SuspendLayout();
- this.groupBox2.SuspendLayout();
- this.groupBox3.SuspendLayout();
- this.groupBox4.SuspendLayout();
- this.panel9.SuspendLayout();
- this.panel8.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.trackBar3)).BeginInit();
- this.panel7.SuspendLayout();
- this.panel6.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.trackBar2)).BeginInit();
- this.panel5.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.trackBar1)).BeginInit();
- this.panel4.SuspendLayout();
- this.panel3.SuspendLayout();
- this.panel2.SuspendLayout();
- this.itemsGroupBox.SuspendLayout();
- 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.button9);
- this.groupBox1.Controls.Add(this.button2);
- this.groupBox1.Controls.Add(this.button1);
- this.groupBox1.Location = new System.Drawing.Point(12, 12);
- this.groupBox1.Name = "groupBox1";
- this.groupBox1.Size = new System.Drawing.Size(808, 45);
- this.groupBox1.TabIndex = 0;
- this.groupBox1.TabStop = false;
- //
- // button9
- //
- this.button9.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.button9.Location = new System.Drawing.Point(468, 13);
- this.button9.Name = "button9";
- this.button9.Size = new System.Drawing.Size(91, 26);
- this.button9.TabIndex = 2;
- this.button9.UseVisualStyleBackColor = true;
- this.button9.Visible = false;
- this.button9.Click += new System.EventHandler(this.button9_Click);
- //
- // button2
- //
- this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.button2.Location = new System.Drawing.Point(592, 14);
- this.button2.Name = "button2";
- this.button2.Size = new System.Drawing.Size(91, 24);
- this.button2.TabIndex = 1;
- this.button2.UseVisualStyleBackColor = true;
- this.button2.Click += new System.EventHandler(this.button2_Click);
- //
- // button1
- //
- this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.button1.Location = new System.Drawing.Point(694, 14);
- this.button1.Name = "button1";
- this.button1.Size = new System.Drawing.Size(91, 24);
- this.button1.TabIndex = 0;
- this.button1.UseVisualStyleBackColor = true;
- this.button1.Click += new System.EventHandler(this.button1_Click);
- //
- // groupBox2
- //
- this.groupBox2.Controls.Add(this.button4);
- this.groupBox2.Controls.Add(this.button3);
- this.groupBox2.Location = new System.Drawing.Point(12, 359);
- this.groupBox2.Name = "groupBox2";
- this.groupBox2.Size = new System.Drawing.Size(233, 57);
- this.groupBox2.TabIndex = 1;
- this.groupBox2.TabStop = false;
- //
- // button4
- //
- this.button4.Location = new System.Drawing.Point(135, 24);
- this.button4.Name = "button4";
- this.button4.Size = new System.Drawing.Size(73, 26);
- this.button4.TabIndex = 3;
- this.button4.UseVisualStyleBackColor = true;
- this.button4.Click += new System.EventHandler(this.button4_Click);
- //
- // button3
- //
- this.button3.Location = new System.Drawing.Point(28, 24);
- this.button3.Name = "button3";
- this.button3.Size = new System.Drawing.Size(73, 26);
- this.button3.TabIndex = 2;
- this.button3.UseVisualStyleBackColor = true;
- this.button3.Click += new System.EventHandler(this.button3_Click);
- //
- // groupBox3
- //
- this.groupBox3.Controls.Add(this.button8);
- this.groupBox3.Controls.Add(this.button7);
- this.groupBox3.Controls.Add(this.button6);
- this.groupBox3.Controls.Add(this.button5);
- this.groupBox3.Location = new System.Drawing.Point(12, 420);
- this.groupBox3.Name = "groupBox3";
- this.groupBox3.Size = new System.Drawing.Size(233, 80);
- this.groupBox3.TabIndex = 1;
- this.groupBox3.TabStop = false;
- //
- // button8
- //
- this.button8.Location = new System.Drawing.Point(135, 49);
- this.button8.Name = "button8";
- this.button8.Size = new System.Drawing.Size(73, 26);
- this.button8.TabIndex = 7;
- this.button8.UseVisualStyleBackColor = true;
- this.button8.Click += new System.EventHandler(this.button8_Click);
- //
- // button7
- //
- this.button7.Location = new System.Drawing.Point(28, 49);
- this.button7.Name = "button7";
- this.button7.Size = new System.Drawing.Size(73, 26);
- this.button7.TabIndex = 6;
- this.button7.UseVisualStyleBackColor = true;
- this.button7.Click += new System.EventHandler(this.button7_Click);
- //
- // button6
- //
- this.button6.Location = new System.Drawing.Point(135, 20);
- this.button6.Name = "button6";
- this.button6.Size = new System.Drawing.Size(73, 26);
- this.button6.TabIndex = 5;
- this.button6.UseVisualStyleBackColor = true;
- this.button6.Click += new System.EventHandler(this.button6_Click);
- //
- // button5
- //
- this.button5.Location = new System.Drawing.Point(28, 20);
- this.button5.Name = "button5";
- this.button5.Size = new System.Drawing.Size(73, 26);
- this.button5.TabIndex = 4;
- this.button5.UseVisualStyleBackColor = true;
- this.button5.Click += new System.EventHandler(this.button5_Click);
- //
- // groupBox7
- //
- this.groupBox7.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.groupBox7.Location = new System.Drawing.Point(251, 63);
- this.groupBox7.Name = "groupBox7";
- this.groupBox7.Size = new System.Drawing.Size(569, 502);
- this.groupBox7.TabIndex = 1;
- this.groupBox7.TabStop = false;
- //
- // groupBox4
- //
- this.groupBox4.Controls.Add(this.panel9);
- this.groupBox4.Controls.Add(this.label7);
- this.groupBox4.Controls.Add(this.panel8);
- this.groupBox4.Controls.Add(this.label6);
- this.groupBox4.Controls.Add(this.panel7);
- this.groupBox4.Controls.Add(this.label5);
- this.groupBox4.Controls.Add(this.panel1);
- this.groupBox4.Controls.Add(this.panel6);
- this.groupBox4.Controls.Add(this.label4);
- this.groupBox4.Controls.Add(this.panel5);
- this.groupBox4.Controls.Add(this.label1);
- this.groupBox4.Controls.Add(this.panel4);
- this.groupBox4.Controls.Add(this.label3);
- this.groupBox4.Controls.Add(this.panel3);
- this.groupBox4.Controls.Add(this.label2);
- this.groupBox4.Controls.Add(this.panel2);
- this.groupBox4.Controls.Add(this.applyLabel);
- this.groupBox4.Controls.Add(this.label17);
- this.groupBox4.Location = new System.Drawing.Point(12, 63);
- this.groupBox4.Name = "groupBox4";
- this.groupBox4.Size = new System.Drawing.Size(233, 290);
- this.groupBox4.TabIndex = 38;
- this.groupBox4.TabStop = false;
- //
- // panel9
- //
- this.panel9.Controls.Add(this.radioButton9);
- this.panel9.Controls.Add(this.radioButton11);
- this.panel9.Location = new System.Drawing.Point(69, 251);
- this.panel9.Name = "panel9";
- this.panel9.Size = new System.Drawing.Size(134, 33);
- this.panel9.TabIndex = 132;
- //
- // radioButton9
- //
- this.radioButton9.AutoSize = true;
- this.radioButton9.Location = new System.Drawing.Point(66, 8);
- this.radioButton9.Name = "radioButton9";
- this.radioButton9.Size = new System.Drawing.Size(47, 16);
- this.radioButton9.TabIndex = 129;
- this.radioButton9.Text = "截距";
- this.radioButton9.UseVisualStyleBackColor = true;
- //
- // radioButton11
- //
- this.radioButton11.AutoSize = true;
- this.radioButton11.Checked = true;
- this.radioButton11.Location = new System.Drawing.Point(16, 8);
- this.radioButton11.Name = "radioButton11";
- this.radioButton11.Size = new System.Drawing.Size(47, 16);
- this.radioButton11.TabIndex = 128;
- this.radioButton11.TabStop = true;
- this.radioButton11.Text = "斜率";
- this.radioButton11.UseVisualStyleBackColor = true;
- //
- // label7
- //
- this.label7.AutoSize = true;
- this.label7.Location = new System.Drawing.Point(6, 261);
- this.label7.Name = "label7";
- this.label7.Size = new System.Drawing.Size(0, 12);
- this.label7.TabIndex = 131;
- //
- // panel8
- //
- this.panel8.Controls.Add(this.trackBar3);
- this.panel8.Location = new System.Drawing.Point(69, 222);
- this.panel8.Name = "panel8";
- this.panel8.Size = new System.Drawing.Size(156, 33);
- this.panel8.TabIndex = 138;
- //
- // trackBar3
- //
- this.trackBar3.AutoSize = false;
- this.trackBar3.Location = new System.Drawing.Point(8, 5);
- this.trackBar3.Maximum = 20;
- this.trackBar3.Minimum = 10;
- this.trackBar3.Name = "trackBar3";
- this.trackBar3.Size = new System.Drawing.Size(134, 22);
- this.trackBar3.TabIndex = 0;
- this.trackBar3.TickStyle = System.Windows.Forms.TickStyle.None;
- this.trackBar3.Value = 10;
- //
- // label6
- //
- this.label6.AutoSize = true;
- this.label6.Location = new System.Drawing.Point(6, 231);
- this.label6.Name = "label6";
- this.label6.Size = new System.Drawing.Size(0, 12);
- this.label6.TabIndex = 137;
- //
- // panel7
- //
- this.panel7.Controls.Add(this.radioButton10);
- this.panel7.Controls.Add(this.radioButton7);
- this.panel7.Controls.Add(this.radioButton8);
- this.panel7.Controls.Add(this.radioButton5);
- this.panel7.Controls.Add(this.radioButton6);
- this.panel7.Location = new System.Drawing.Point(69, 163);
- this.panel7.Name = "panel7";
- this.panel7.Size = new System.Drawing.Size(158, 63);
- this.panel7.TabIndex = 132;
- //
- // radioButton10
- //
- this.radioButton10.AutoSize = true;
- this.radioButton10.Location = new System.Drawing.Point(7, 42);
- this.radioButton10.Name = "radioButton10";
- this.radioButton10.Size = new System.Drawing.Size(71, 16);
- this.radioButton10.TabIndex = 132;
- this.radioButton10.Text = "线性调整";
- this.radioButton10.UseVisualStyleBackColor = true;
- this.radioButton10.CheckedChanged += new System.EventHandler(this.radioButton10_CheckedChanged);
- //
- // radioButton7
- //
- this.radioButton7.AutoSize = true;
- this.radioButton7.Location = new System.Drawing.Point(80, 22);
- this.radioButton7.Name = "radioButton7";
- this.radioButton7.Size = new System.Drawing.Size(71, 16);
- this.radioButton7.TabIndex = 131;
- this.radioButton7.Text = "整体调亮";
- this.radioButton7.UseVisualStyleBackColor = true;
- this.radioButton7.CheckedChanged += new System.EventHandler(this.radioButton7_CheckedChanged);
- //
- // radioButton8
- //
- this.radioButton8.AutoSize = true;
- this.radioButton8.Location = new System.Drawing.Point(7, 22);
- this.radioButton8.Name = "radioButton8";
- this.radioButton8.Size = new System.Drawing.Size(71, 16);
- this.radioButton8.TabIndex = 130;
- this.radioButton8.Text = "整体调暗";
- this.radioButton8.UseVisualStyleBackColor = true;
- this.radioButton8.CheckedChanged += new System.EventHandler(this.radioButton8_CheckedChanged);
- //
- // radioButton5
- //
- this.radioButton5.AutoSize = true;
- this.radioButton5.Location = new System.Drawing.Point(81, 3);
- this.radioButton5.Name = "radioButton5";
- this.radioButton5.Size = new System.Drawing.Size(71, 16);
- this.radioButton5.TabIndex = 129;
- this.radioButton5.Text = "自动调整";
- this.radioButton5.UseVisualStyleBackColor = true;
- this.radioButton5.CheckedChanged += new System.EventHandler(this.radioButton5_CheckedChanged);
- //
- // radioButton6
- //
- this.radioButton6.AutoSize = true;
- this.radioButton6.Checked = true;
- this.radioButton6.Location = new System.Drawing.Point(8, 3);
- this.radioButton6.Name = "radioButton6";
- this.radioButton6.Size = new System.Drawing.Size(59, 16);
- this.radioButton6.TabIndex = 128;
- this.radioButton6.TabStop = true;
- this.radioButton6.Text = "不调整";
- this.radioButton6.UseVisualStyleBackColor = true;
- this.radioButton6.CheckedChanged += new System.EventHandler(this.radioButton6_CheckedChanged);
- //
- // label5
- //
- this.label5.AutoSize = true;
- this.label5.Location = new System.Drawing.Point(6, 173);
- this.label5.Name = "label5";
- this.label5.Size = new System.Drawing.Size(0, 12);
- this.label5.TabIndex = 131;
- //
- // panel1
- //
- this.panel1.BackColor = System.Drawing.Color.Red;
- this.panel1.Location = new System.Drawing.Point(85, 39);
- this.panel1.Name = "panel1";
- this.panel1.Size = new System.Drawing.Size(72, 21);
- this.panel1.TabIndex = 20;
- this.panel1.Click += new System.EventHandler(this.panel1_click);
- //
- // panel6
- //
- this.panel6.Controls.Add(this.trackBar2);
- this.panel6.Location = new System.Drawing.Point(69, 136);
- this.panel6.Name = "panel6";
- this.panel6.Size = new System.Drawing.Size(156, 33);
- this.panel6.TabIndex = 136;
- //
- // trackBar2
- //
- this.trackBar2.AutoSize = false;
- this.trackBar2.Location = new System.Drawing.Point(8, 5);
- this.trackBar2.Maximum = 50;
- this.trackBar2.Minimum = 10;
- this.trackBar2.Name = "trackBar2";
- this.trackBar2.Size = new System.Drawing.Size(134, 22);
- this.trackBar2.TabIndex = 0;
- this.trackBar2.TickStyle = System.Windows.Forms.TickStyle.None;
- this.trackBar2.Value = 10;
- //
- // label4
- //
- this.label4.AutoSize = true;
- this.label4.Location = new System.Drawing.Point(6, 145);
- this.label4.Name = "label4";
- this.label4.Size = new System.Drawing.Size(0, 12);
- this.label4.TabIndex = 135;
- //
- // panel5
- //
- this.panel5.Controls.Add(this.trackBar1);
- this.panel5.Location = new System.Drawing.Point(69, 109);
- this.panel5.Name = "panel5";
- this.panel5.Size = new System.Drawing.Size(156, 33);
- this.panel5.TabIndex = 134;
- //
- // trackBar1
- //
- this.trackBar1.AutoSize = false;
- this.trackBar1.Location = new System.Drawing.Point(8, 5);
- this.trackBar1.Maximum = 40;
- this.trackBar1.Minimum = 10;
- this.trackBar1.Name = "trackBar1";
- this.trackBar1.Size = new System.Drawing.Size(134, 22);
- this.trackBar1.TabIndex = 0;
- this.trackBar1.TickStyle = System.Windows.Forms.TickStyle.None;
- this.trackBar1.Value = 30;
- //
- // label1
- //
- this.label1.AutoSize = true;
- this.label1.Location = new System.Drawing.Point(6, 118);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(0, 12);
- this.label1.TabIndex = 133;
- //
- // panel4
- //
- this.panel4.Controls.Add(this.radioButton3);
- this.panel4.Controls.Add(this.radioButton4);
- this.panel4.Location = new System.Drawing.Point(69, 82);
- this.panel4.Name = "panel4";
- this.panel4.Size = new System.Drawing.Size(156, 33);
- this.panel4.TabIndex = 132;
- //
- // radioButton3
- //
- this.radioButton3.AutoSize = true;
- this.radioButton3.Location = new System.Drawing.Point(83, 8);
- this.radioButton3.Name = "radioButton3";
- this.radioButton3.Size = new System.Drawing.Size(59, 16);
- this.radioButton3.TabIndex = 129;
- this.radioButton3.Text = "亮晶界";
- this.radioButton3.UseVisualStyleBackColor = true;
- //
- // radioButton4
- //
- this.radioButton4.AutoSize = true;
- this.radioButton4.Checked = true;
- this.radioButton4.Location = new System.Drawing.Point(7, 8);
- this.radioButton4.Name = "radioButton4";
- this.radioButton4.Size = new System.Drawing.Size(59, 16);
- this.radioButton4.TabIndex = 128;
- this.radioButton4.TabStop = true;
- this.radioButton4.Text = "暗晶界";
- this.radioButton4.UseVisualStyleBackColor = true;
- //
- // label3
- //
- this.label3.AutoSize = true;
- this.label3.Location = new System.Drawing.Point(6, 92);
- this.label3.Name = "label3";
- this.label3.Size = new System.Drawing.Size(0, 12);
- this.label3.TabIndex = 131;
- //
- // panel3
- //
- this.panel3.Controls.Add(this.radioButton1);
- this.panel3.Controls.Add(this.radioButton2);
- this.panel3.Location = new System.Drawing.Point(69, 55);
- this.panel3.Name = "panel3";
- this.panel3.Size = new System.Drawing.Size(134, 33);
- this.panel3.TabIndex = 132;
- //
- // radioButton1
- //
- this.radioButton1.AutoSize = true;
- this.radioButton1.Location = new System.Drawing.Point(68, 8);
- this.radioButton1.Name = "radioButton1";
- this.radioButton1.Size = new System.Drawing.Size(29, 16);
- this.radioButton1.TabIndex = 129;
- this.radioButton1.Text = "2";
- this.radioButton1.UseVisualStyleBackColor = true;
- this.radioButton1.CheckedChanged += new System.EventHandler(this.radioButton1_CheckedChanged);
- //
- // radioButton2
- //
- this.radioButton2.AutoSize = true;
- this.radioButton2.Checked = true;
- this.radioButton2.Location = new System.Drawing.Point(7, 8);
- this.radioButton2.Name = "radioButton2";
- this.radioButton2.Size = new System.Drawing.Size(29, 16);
- this.radioButton2.TabIndex = 128;
- this.radioButton2.TabStop = true;
- this.radioButton2.Text = "1";
- this.radioButton2.UseVisualStyleBackColor = true;
- this.radioButton2.CheckedChanged += new System.EventHandler(this.radioButton2_CheckedChanged);
- //
- // label2
- //
- this.label2.AutoSize = true;
- this.label2.Location = new System.Drawing.Point(6, 65);
- this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(0, 12);
- this.label2.TabIndex = 131;
- //
- // panel2
- //
- this.panel2.Controls.Add(this.applyRadioButton2);
- this.panel2.Controls.Add(this.applyRadioButton1);
- this.panel2.Location = new System.Drawing.Point(69, 12);
- this.panel2.Name = "panel2";
- this.panel2.Size = new System.Drawing.Size(134, 33);
- this.panel2.TabIndex = 130;
- //
- // applyRadioButton2
- //
- this.applyRadioButton2.AutoSize = true;
- this.applyRadioButton2.Location = new System.Drawing.Point(68, 8);
- this.applyRadioButton2.Name = "applyRadioButton2";
- this.applyRadioButton2.Size = new System.Drawing.Size(35, 16);
- this.applyRadioButton2.TabIndex = 129;
- this.applyRadioButton2.Text = "否";
- this.applyRadioButton2.UseVisualStyleBackColor = true;
- //
- // applyRadioButton1
- //
- this.applyRadioButton1.AutoSize = true;
- this.applyRadioButton1.Checked = true;
- this.applyRadioButton1.Location = new System.Drawing.Point(7, 8);
- this.applyRadioButton1.Name = "applyRadioButton1";
- this.applyRadioButton1.Size = new System.Drawing.Size(35, 16);
- this.applyRadioButton1.TabIndex = 128;
- this.applyRadioButton1.TabStop = true;
- this.applyRadioButton1.Text = "是";
- this.applyRadioButton1.UseVisualStyleBackColor = true;
- //
- // applyLabel
- //
- this.applyLabel.AutoSize = true;
- this.applyLabel.Location = new System.Drawing.Point(6, 22);
- this.applyLabel.Name = "applyLabel";
- this.applyLabel.Size = new System.Drawing.Size(0, 12);
- this.applyLabel.TabIndex = 127;
- //
- // label17
- //
- this.label17.AutoSize = true;
- this.label17.Location = new System.Drawing.Point(6, 43);
- this.label17.Name = "label17";
- this.label17.Size = new System.Drawing.Size(0, 12);
- this.label17.TabIndex = 124;
- //
- // itemsGroupBox
- //
- this.itemsGroupBox.Controls.Add(this.undoButton);
- this.itemsGroupBox.Controls.Add(this.redoButton);
- this.itemsGroupBox.Controls.Add(this.resetButton);
- this.itemsGroupBox.Location = new System.Drawing.Point(12, 506);
- this.itemsGroupBox.Name = "itemsGroupBox";
- this.itemsGroupBox.Size = new System.Drawing.Size(233, 59);
- this.itemsGroupBox.TabIndex = 39;
- this.itemsGroupBox.TabStop = false;
- this.itemsGroupBox.Text = "操作";
- //
- // undoButton
- //
- this.undoButton.Location = new System.Drawing.Point(156, 23);
- this.undoButton.Name = "undoButton";
- this.undoButton.Size = new System.Drawing.Size(64, 26);
- this.undoButton.TabIndex = 10;
- this.undoButton.UseVisualStyleBackColor = true;
- this.undoButton.Click += new System.EventHandler(this.undoButton_Click);
- //
- // redoButton
- //
- this.redoButton.Location = new System.Drawing.Point(86, 23);
- this.redoButton.Name = "redoButton";
- this.redoButton.Size = new System.Drawing.Size(64, 26);
- this.redoButton.TabIndex = 9;
- this.redoButton.UseVisualStyleBackColor = true;
- this.redoButton.Click += new System.EventHandler(this.redoButton_Click);
- //
- // resetButton
- //
- this.resetButton.Location = new System.Drawing.Point(16, 23);
- this.resetButton.Name = "resetButton";
- this.resetButton.Size = new System.Drawing.Size(64, 26);
- this.resetButton.TabIndex = 8;
- this.resetButton.UseVisualStyleBackColor = true;
- this.resetButton.Click += new System.EventHandler(this.resetButton_Click);
- //
- // GrainBoundaryEditingDialog
- //
- this.ClientSize = new System.Drawing.Size(832, 577);
- this.Controls.Add(this.itemsGroupBox);
- this.Controls.Add(this.groupBox4);
- this.Controls.Add(this.groupBox2);
- this.Controls.Add(this.groupBox3);
- this.Controls.Add(this.groupBox7);
- this.Controls.Add(this.groupBox1);
- this.MaximizeBox = false;
- this.MinimizeBox = false;
- this.MinimumSize = new System.Drawing.Size(848, 616);
- this.Name = "GrainBoundaryEditingDialog";
- this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.GrainBoundryEditingDialog_FormClosing);
- this.Load += new System.EventHandler(this.GrainBoundryEditingDialog_Load);
- this.groupBox1.ResumeLayout(false);
- this.groupBox2.ResumeLayout(false);
- this.groupBox3.ResumeLayout(false);
- this.groupBox4.ResumeLayout(false);
- this.groupBox4.PerformLayout();
- this.panel9.ResumeLayout(false);
- this.panel9.PerformLayout();
- this.panel8.ResumeLayout(false);
- ((System.ComponentModel.ISupportInitialize)(this.trackBar3)).EndInit();
- this.panel7.ResumeLayout(false);
- this.panel7.PerformLayout();
- this.panel6.ResumeLayout(false);
- ((System.ComponentModel.ISupportInitialize)(this.trackBar2)).EndInit();
- this.panel5.ResumeLayout(false);
- ((System.ComponentModel.ISupportInitialize)(this.trackBar1)).EndInit();
- this.panel4.ResumeLayout(false);
- this.panel4.PerformLayout();
- this.panel3.ResumeLayout(false);
- this.panel3.PerformLayout();
- this.panel2.ResumeLayout(false);
- this.panel2.PerformLayout();
- this.itemsGroupBox.ResumeLayout(false);
- this.ResumeLayout(false);
- }
- /// <summary>
- /// 折线添加
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button3_Click(object sender, EventArgs e)
- {
- if (this.documentWorkspace.PhaseModels[0].mat == null)
- {
- MessageBox.Show(PdnResources.GetString("Menu.Pleaseperformuctionfirst.text"));
- return;
- }
- pointFloatArray.Clear();
- startPoint = new Point(-1, -1);
- drawedStartPoint = false;
- endPoint = new Point(-1, -1);
- pointKtype = 1;
- this.documentWorkspace.Refresh();
- }
- /// <summary>
- /// 直线添加
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button4_Click(object sender, EventArgs e)
- {
- if (this.documentWorkspace.PhaseModels[0].mat == null)
- {
- MessageBox.Show(PdnResources.GetString("Menu.Pleaseperformuctionfirst.text"));
- return;
- }
- startPoint = new Point(-1, -1);
- drawedStartPoint = false;
- endPoint = new Point(-1, -1);
- pointKtype = 2;
- this.documentWorkspace.Refresh();
- }
- 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.InclusionNoEffect;
- this.documentWorkspace.Cursor = Cursors.Default;
- }
- private void mobileModeButton_Click(object sender, EventArgs e)
- {
- this.documentWorkspace.ActiveTool = Annotation.Enum.DrawToolType.MoveMode;
- }
- //确定按钮点击事件
- private void button1_Click(object sender, EventArgs e)
- {
- this.PhaseMat = this.documentWorkspace.PhaseModels[0].mat;
- this.DialogResult = DialogResult.OK;
- this.Close();
- }
- /// <summary>
- /// 用于get处理后的图像
- /// </summary>
- public Mat PhaseMat
- {
- get
- {
- return this.phaseMat;
- }
- set
- {
- this.phaseMat = value;
- }
- }
- /// <summary>
- /// 用于get处理后的图像相的颜色
- /// </summary>
- public Color PhaseColor
- {
- get
- {
- return this.phaseColor;
- }
- set
- {
- this.phaseColor = value;
- }
- }
- /// <summary>
- /// 矩形删除
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button7_Click(object sender, EventArgs e)
- {
- if (this.documentWorkspace.PhaseModels[0].mat == null)
- {
- MessageBox.Show(PdnResources.GetString("Menu.Pleaseperformuctionfirst.text"));
- return;
- }
- startPoint = new Point(-1, -1);
- drawedStartPoint = false;
- endPoint = new Point(-1, -1);
- this.rectangle.X = -1;
- this.rectangle.Y = -1;
- this.rectangle.Width = 0;
- this.rectangle.Height = 0;
- this.pointKtype = 13;
- this.documentWorkspace.Refresh();
- }
- /// <summary>
- /// 椭圆删除
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button8_Click(object sender, EventArgs e)
- {
- if (this.documentWorkspace.PhaseModels[0].mat == null)
- {
- MessageBox.Show(PdnResources.GetString("Menu.Pleaseperformuctionfirst.text"));
- return;
- }
- startPoint = new Point(-1, -1);
- drawedStartPoint = false;
- endPoint = new Point(-1, -1);
- this.rectangle.X = -1;
- this.rectangle.Y = -1;
- this.rectangle.Width = 0;
- this.rectangle.Height = 0;
- this.pointKtype = 14;
- this.documentWorkspace.Refresh();
- }
- /// <summary>
- /// 圆形删除
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button6_Click(object sender, EventArgs e)
- {
- if (this.documentWorkspace.PhaseModels[0].mat == null)
- {
- MessageBox.Show(PdnResources.GetString("Menu.Pleaseperformuctionfirst.text"));
- return;
- }
- startPoint = new Point(-1, -1);
- drawedStartPoint = false;
- endPoint = new Point(-1, -1);
- this.rectangle.X = -1;
- this.rectangle.Y = -1;
- this.rectangle.Width = 0;
- this.rectangle.Height = 0;
- this.pointKtype = 12;
- this.documentWorkspace.Refresh();
- }
- /// <summary>
- /// 多边形删除
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button5_Click(object sender, EventArgs e)
- {
- if (this.documentWorkspace.PhaseModels[0].mat == null)
- {
- MessageBox.Show(PdnResources.GetString("Menu.Pleaseperformuctionfirst.text"));
- return;
- }
- pointFloatArray.Clear();
- startPoint = new Point(-1, -1);
- drawedStartPoint = false;
- endPoint = new Point(-1, -1);
- this.rectangle.X = -1;
- this.rectangle.Y = -1;
- this.rectangle.Width = 0;
- this.rectangle.Height = 0;
- this.pointKtype = 11;
- this.documentWorkspace.Refresh();
- }
- private void button2_Click(object sender, EventArgs e)
- {
- this.applyDect();
- //this.Close();//##################################
- }
- /// <summary>
- /// 撤销按钮点击事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button9_Click(object sender, EventArgs e)
- {
- }
- #region 晶界重现方法
- ProgressThreadProcClass procClass;
- int grainApplygrainboundaries;
- int adOutParam0;
- int adOutParam1;
- double adOutParam2;// = 3;
- double adOutParam3;
- int adOutParam4;
- double adOutParam5;
- int adOutParam6;
- Mat OrgImg0;
- private int getAdOutParam4Value()
- {
- int adOutParam = 0;
- if (this.radioButton6.Checked) adOutParam = 0;
- else if (this.radioButton5.Checked) adOutParam = 1;
- else if (this.radioButton8.Checked) adOutParam = 2;
- else if (this.radioButton7.Checked) adOutParam = 3;
- else if (this.radioButton10.Checked) adOutParam = 4;
- return adOutParam;
- }
- private void applyDect()
- {
- if (this.imageMat == null)
- {
- return;
- }
- //string inputImageFile = "原始图片1.jpg";// "j1.JPG";
- ////char[] inputImageFile2 = inputImageFile.ToCharArray();
- grainApplygrainboundaries = this.applyRadioButton1.Checked ? 1 : 0;
- adOutParam0 = this.radioButton1/*checkBox3*/.Checked ? 2 : 1;
- adOutParam1 = this.radioButton3.Checked ? 2 : 0;
- adOutParam2 = this.trackBar1.Value / 10.0;
- adOutParam3 = this.trackBar2.Value / 10.0;
- adOutParam4 = this.getAdOutParam4Value();
- adOutParam5 = this.trackBar3.Value / 10.0;
- adOutParam6 = this.radioButton11.Checked ? 0 : 1;
- /*int */
- //dark = this.comboBox2.SelectedIndex;// 2;//指定晶界类型,暗晶界dark=1, 否则dark=0, dark=2梯度
- /*int */
- //smooth_type = this.comboBox3.SelectedIndex;// 1;//去噪类型: 高斯平滑: smooth_type=0; 方向平滑: smooth_type=1
- /*double[] */
- //cell_size = new double[2] { (double)numericUpDown1.Value, (double)numericUpDown2.Value }; ;// new double[2] { 0.01, 500 };//晶界大小
- procClass = new ProgressThreadProcClass();
- procClass.StartProgressAutoAction(this, new System.Threading.ThreadStart(applyDectAction), PdnResources.GetString("Menu.Grainboundarytoreproduce.text"));
- //if (isOtherGrainSizeStandardDialog)
- //{
- // if (OrgImg0 != null)
- // {
- // this.documentWorkspace.PhaseModels[1].mat = OrgImg0.Clone();
- // this.documentWorkspace.Refresh();
- // OrgImg0 = null;
- // }
- // if (OrgImg != null)
- // {
- // OrgImg.Dispose();
- // OrgImg = null;
- // }
- // return;//##
- //}
- if (OrgImg0 != null)
- {
- if (getCurrentWorkspace().GraphicsList.IsExsitView() && ShowDrawClassView)
- {
- Vec4b vec4 = new Vec4b(0, 0, 0, 0);
- //视场图像
- Mat exsitViewMatOrg = PaintDotNet.Camera.Tools.ToMat(getCurrentWorkspace().GetFullSizeWithRegion());
- for (int y = 0; y < exsitViewMatOrg/*temp*/.Rows; y++)
- {
- for (int x = 0; x < exsitViewMatOrg/*temp*/.Cols; x++)
- {
- if (exsitViewMatOrg.At<Vec4b>(y, x).Item3 == 0)
- OrgImg0.Set(y, x, vec4);//不在视场图像范围内
- }
- }
- }
- this.documentWorkspace.PhaseModels[0].mat = OrgImg0.Clone();
- this.documentWorkspace.Refresh();
- if (PhaseModel0MatCopy != null)
- {
- PhaseModel0MatCopy.Dispose();
- PhaseModel0MatCopy = null;
- }
- PhaseModel0MatCopy = this.documentWorkspace.PhaseModels[0].mat.Clone();
- this.resetOperationsAction();
- OrgImg0.Dispose();//待测试
- OrgImg0 = null;
- }
- ////this.runDect(OrgImg, dark, smooth_type, sigma, enhance, cell_size);//###########################2
- //if (!isAreaType)
- // AddRectangleToRectangleFCaps();//0916###18747
- //else
- //{
- // GetClassNumberOfGrains();
- //}
- }
- private void applyDectAction()
- {
- OrgImg0 = /*GrainBoundaryEditingDialog.*/runDect(this.panel1.BackColor, imageMat.Clone(), adOutParam0, adOutParam1, (int)adOutParam2, (int)adOutParam3, adOutParam4, adOutParam5, adOutParam6);
- if (procClass != null) procClass.DismissProgressAction(this);
- }
- public static Mat runDect(Color phaseColor, Mat OrgImg0, int adOutParam0, int adOutParam1, int adOutParam2, int adOutParam3, int adOutParam4, double adOutParam5, int adOutParam6)
- {
- Mat GryImg = new Mat();
- Mat OrgImg = new Mat();
- if (4 == OrgImg0.Channels())
- Cv2.CvtColor(OrgImg0, OrgImg, ColorConversionCodes.BGRA2BGR);
- else
- OrgImg = OrgImg0.Clone();
- //转为为灰度
- if (3 == OrgImg.Channels() || 4 == OrgImg.Channels())
- Cv2.CvtColor(OrgImg, GryImg, ColorConversionCodes.BGR2GRAY/*RGB2GRAY*/);
- else
- if (1 == OrgImg.Channels())
- GryImg = OrgImg.Clone();
- else
- return null;
- //if (0 == m_iStandardImage)
- {
- //调用算法
- OUTsegmsurf RSTss = new OLDcellsegm().mf_segmsurf_progress_auto(GryImg, phaseColor, adOutParam0, adOutParam1, adOutParam2, adOutParam3, adOutParam4, adOutParam5, adOutParam6);
- Cv2.CvtColor(RSTss.wat, OrgImg0, ColorConversionCodes.BGR2BGRA);
- }
- //else OrgImg0/*Mat WAT*/ = new OLDcellsegm().ProFroStandardImage(GryImg, iConnect, phaseColor);
- return OrgImg0;
- }
- private void panel1_click(object sender, EventArgs e)
- {
- this.panelC = (Panel)sender;
- this.colorsFormGrid.UserPrimaryColor = ColorBgra.FromColor(((Panel)sender).BackColor);
- this.colorsFormGrid.ShowDialog();
- }
- #endregion
- private void GrainBoundryEditingDialog_FormClosing(object sender, FormClosingEventArgs e)
- {
- string xmlFilePath = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\GrainSizeAnalyze\\GrainBoundryDectModel_" + this.menuId + ".xml";
- bool createNewFile = !System.IO.File.Exists(xmlFilePath);
- if (createNewFile)
- xmlFilePath = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\GrainSizeAnalyze\\GrainBoundryDectModel.xml";
- Base.SettingModel.GrainBoundryDectModel grainBoundryDectModel = Base.CommTool.XmlSerializeHelper.DESerializer<Base.SettingModel.GrainBoundryDectModel>(Base.CommTool.FileOperationHelper.ReadStringFromFile(xmlFilePath, System.IO.FileMode.Open));
- //# 保存参数
- adOutParam0 = this.radioButton1.Checked ? 2 : 1;
- grainBoundryDectModel.m_AdOutParam_0 = adOutParam0;
- adOutParam1 = this.radioButton3.Checked ? 2 : 0;
- grainBoundryDectModel.m_AdOutParam_1 = adOutParam1;
- adOutParam2 = this.trackBar1.Value / 10.0;
- grainBoundryDectModel.m_AdOutParam_2 = adOutParam2;
- adOutParam3 = this.trackBar2.Value / 10.0;
- grainBoundryDectModel.m_AdOutParam_3 = adOutParam3;
- adOutParam4 = this.getAdOutParam4Value();
- grainBoundryDectModel.m_AdOutParam_4 = adOutParam4;
- adOutParam5 = this.trackBar3.Value / 10.0;
- grainBoundryDectModel.m_AdOutParam_5 = adOutParam5;
- adOutParam6 = this.radioButton11.Checked ? 0 : 1;
- grainBoundryDectModel.m_AdOutParam_6 = adOutParam6;
- grainBoundryDectModel.grainColor = this.phaseColor.ToArgb();
- grainApplygrainboundaries = this.applyRadioButton1.Checked ? 1 : 0;
- grainBoundryDectModel.grainApplygrainboundaries = grainApplygrainboundaries;
- xmlFilePath = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\GrainSizeAnalyze\\GrainBoundryDectModel_" + this.menuId + ".xml";
- string userInfoXml = Base.CommTool.XmlSerializeHelper.XmlSerialize<Base.SettingModel.GrainBoundryDectModel>(grainBoundryDectModel);
- Base.CommTool.FileOperationHelper.WriteStringToFile(userInfoXml, xmlFilePath, System.IO.FileMode.Create);
- }
- private void GrainBoundryEditingDialog_Load(object sender, EventArgs e)
- {
- string xmlFilePath = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\GrainSizeAnalyze\\GrainBoundryDectModel_" + this.menuId + ".xml";
- bool createNewFile = !System.IO.File.Exists(xmlFilePath);
- if (createNewFile)
- return;
- Base.SettingModel.GrainBoundryDectModel grainBoundryDectModel = Base.CommTool.XmlSerializeHelper.DESerializer<Base.SettingModel.GrainBoundryDectModel>(Base.CommTool.FileOperationHelper.ReadStringFromFile(xmlFilePath, System.IO.FileMode.Open));
- this.phaseColor = Color.FromArgb(grainBoundryDectModel.grainColor == 0 ? Color.Red.ToArgb() : grainBoundryDectModel.grainColor);
- this.panel1.BackColor = this.phaseColor;
- //# 读取参数
- adOutParam0 = grainBoundryDectModel.m_AdOutParam_0;
- this.radioButton1.Checked = (adOutParam0 == 2);
- adOutParam1 = grainBoundryDectModel.m_AdOutParam_1;
- this.radioButton3.Checked = (adOutParam1 == 2);
- adOutParam2 = grainBoundryDectModel.m_AdOutParam_2;
- this.trackBar1.Value = (int)(adOutParam2 * 10.0);
- adOutParam3 = grainBoundryDectModel.m_AdOutParam_3;
- this.trackBar2.Value = (int)(adOutParam3 * 10.0);
- adOutParam4 = grainBoundryDectModel.m_AdOutParam_4;
- int adOutParam = adOutParam4;
- switch (adOutParam)
- {
- case 0:
- this.radioButton6.Checked = true;
- break;
- case 1:
- this.radioButton5.Checked = true;
- break;
- case 2:
- this.radioButton8.Checked = true;
- break;
- case 3:
- this.radioButton7.Checked = true;
- break;
- case 4:
- this.radioButton10.Checked = true;
- break;
- default:
- break;
- }
- adOutParam5 = grainBoundryDectModel.m_AdOutParam_5;
- this.trackBar3.Value = (int)(adOutParam5 * 10.0);
- adOutParam6 = grainBoundryDectModel.m_AdOutParam_6;
- this.radioButton11.Checked = (adOutParam6 == 0);
- this.radioButton9.Checked = (adOutParam6 == 1);
- this.refreshRadioStatus();
- grainApplygrainboundaries = grainBoundryDectModel.grainApplygrainboundaries;
- this.applyRadioButton1.Checked = (grainApplygrainboundaries == 1);
- this.applyRadioButton2.Checked = (grainApplygrainboundaries != 1);
- }
- /// <summary>
- /// 根据当前操作位置处理图片,并刷新操作按钮状态
- /// </summary>
- /// <param name="OperationTag"></param>
- private void RefreshMatsToIndex(int OperationTag)
- {
- //...处理图片(this.OperationIndex)
- this.OperationIndex = OperationTag;
- ///// 操作类型
- //private int pointKtype = 0;
- if (PhaseModel0MatCopy != null && this.OperationIndex >= 0)
- {
- Mat newModel0Mat = PhaseModel0MatCopy.Clone();
- for (int i = 0; i <= this.OperationIndex; i++)
- {
- //操作类型 0,没有操作 1,折线添加 2,直线添加 11,多边形删除 12,圆形删除 13,矩形删除 14,椭圆删除
- int opeType = this.OperationKtypeList[i];
- PointF[] opePoints = this.OperationsList[i];
- // 折线删除
- if (opeType == 11 && opePoints.Length > 1)
- {
- newModel0Mat/*this.documentWorkspace.PhaseModels[0].mat*/ = PreActionIntent.PolygonDelete(newModel0Mat/*this.documentWorkspace.PhaseModels[0].mat*/, opePoints.ToList()/*pointFloatArray*/);
- //this.pointKtype = 0;
- //this.documentWorkspace.Refresh();
- }
- // 折线添加
- if (opeType == 1 && opePoints.Length > 1)
- {
- //保存处理后的图片
- Bitmap originalBit = OpenCvSharp.Extensions.BitmapConverter.ToBitmap(newModel0Mat);
- Bitmap newBit = originalBit.Clone(new Rectangle(0, 0, originalBit.Width, originalBit.Height), originalBit.PixelFormat);
- Graphics graphics = Graphics.FromImage(newBit);
- //Draw(graphics, false);
- // 抗锯齿
- graphics.SmoothingMode = SmoothingMode.AntiAlias;
- // 折线添加
- if (opeType == 1 && opePoints.Length >= 2)
- {
- Pen pen = new Pen(this.phaseColor, 1);
- graphics.DrawLines(pen, opePoints);
- pen.Dispose();
- }
- newModel0Mat = PaintDotNet.Camera.Tools.ToMat(newBit);
- }
- // 圆形删除/椭圆删除
- if ((opeType == 14 || opeType == 12) && opePoints.Length == 2)
- {
- RectangleF rectangleFOpe = new RectangleF(opePoints[0].X, opePoints[0].Y, opePoints[1].X, opePoints[1].Y);
- if (this.pointKtype == 14)
- newModel0Mat = PreActionIntent.OvalDelete(newModel0Mat, rectangleFOpe);
- else
- newModel0Mat = PreActionIntent.OvalDelete(newModel0Mat, rectangleFOpe);
- }
- // 矩形删除
- if (opeType == 13 && opePoints.Length == 2)
- {
- RectangleF rectangleFOpe = new RectangleF(opePoints[0].X, opePoints[0].Y, opePoints[1].X, opePoints[1].Y);
- newModel0Mat = PreActionIntent.RectangleDelete(newModel0Mat, rectangleFOpe);
- }
- // 直线添加
- if (opeType == 2 && opePoints.Length == 2/*this.startPoint.X > -1 && this.startPoint.Y > -1*/)
- {
- //保存处理后的图片
- Bitmap originalBit = OpenCvSharp.Extensions.BitmapConverter.ToBitmap(newModel0Mat);
- Bitmap newBit = originalBit.Clone(new Rectangle(0, 0, originalBit.Width, originalBit.Height), originalBit.PixelFormat);
- Graphics graphics = Graphics.FromImage(newBit);
- //Draw(graphics, false);
- // 抗锯齿
- graphics.SmoothingMode = SmoothingMode.AntiAlias;
- // 直线添加
- if (opeType == 2 && opePoints.Length == 2/*this.startPoint.X > -1 && this.startPoint.Y > -1 && this.endPoint.X > -1 && this.endPoint.Y > -1*/)
- {
- Pen pen = new Pen(this.phaseColor, 1);
- graphics.DrawLine(pen, opePoints[0].X, opePoints[0].Y, opePoints[1].X, opePoints[1].Y);
- //////pen.DashStyle = DashStyle.Dash;
- //g.DrawLine(pen, startPoint.X, startPoint.Y, endPoint.X, endPoint.Y);
- pen.Dispose();
- }
- newModel0Mat = PaintDotNet.Camera.Tools.ToMat(newBit);
- }
- }
- this.documentWorkspace.PhaseModels[0].mat = newModel0Mat;
- this.documentWorkspace.Refresh();
- }
- else if (PhaseModel0MatCopy != null)
- {
- this.documentWorkspace.PhaseModels[0].mat = PhaseModel0MatCopy.Clone();
- this.documentWorkspace.Refresh();
- }
- //刷新操作按钮的状态
- this.RefreshOperationsButtons();
- }
- /// <summary>
- /// 操作-重置
- /// </summary>
- private void resetOperationsAction()
- {
- this.OperationIndex = -1;
- this.RefreshOperationsToIndex();
- this.RefreshOperationsButtons();
- }
- /// <summary>
- /// 操作-重置
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void resetButton_Click(object sender, EventArgs e)
- {
- if (PhaseModel0MatCopy != null)
- {
- this.documentWorkspace.PhaseModels[0].mat = PhaseModel0MatCopy.Clone();
- this.documentWorkspace.Refresh();
- }
- this.resetOperationsAction();
- }
- /// <summary>
- /// 操作-撤销
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void undoButton_Click(object sender, EventArgs e)
- {
- if (this.OperationIndex >= 0)
- {
- this.RefreshMatsToIndex(this.OperationIndex - 1);
- }
- else
- this.undoButton.Enabled = false;
- }
- /// <summary>
- /// 操作-恢复
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void redoButton_Click(object sender, EventArgs e)
- {
- if (this.OperationIndex < this.OperationKtypeList.Count - 1)
- {
- this.RefreshMatsToIndex(this.OperationIndex + 1);
- }
- else
- this.redoButton.Enabled = false;
- }
- private void radioButton1_CheckedChanged(object sender, EventArgs e)
- {
- if (radioButton1.Checked)
- {
- this.label3.Enabled = false;
- this.radioButton3.Enabled = false;
- this.radioButton4.Enabled = false;
- this.label1.Enabled = false;
- this.trackBar1.Enabled = false;
- this.label4.Enabled = false;
- this.trackBar2.Enabled = false;
- this.label5.Enabled = false;
- this.radioButton6.Enabled = false;
- this.radioButton5.Enabled = false;
- this.radioButton8.Enabled = false;
- this.radioButton7.Enabled = false;
- this.radioButton10.Enabled = false;
- this.label6.Enabled = false;
- this.trackBar3.Enabled = false;
- this.label7.Enabled = false;
- this.radioButton11.Enabled = false;
- this.radioButton9.Enabled = false;
- }
- }
- private void radioButton2_CheckedChanged(object sender, EventArgs e)
- {
- if (radioButton2.Checked)
- {
- this.label3.Enabled = true;
- this.radioButton3.Enabled = true;
- this.radioButton4.Enabled = true;
- this.label1.Enabled = true;
- this.trackBar1.Enabled = true;
- this.label4.Enabled = true;
- this.trackBar2.Enabled = true;
- this.label5.Enabled = true;
- this.radioButton6.Enabled = true;
- this.radioButton5.Enabled = true;
- this.radioButton8.Enabled = true;
- this.radioButton7.Enabled = true;
- this.radioButton10.Enabled = true;
- this.refreshRadioStatus();
- }
- }
- private void refreshRadioStatus()
- {
- if (radioButton6.Checked)
- {
- this.label6.Enabled = false;
- this.trackBar3.Enabled = false;
- this.label7.Enabled = false;
- this.radioButton11.Enabled = false;
- this.radioButton9.Enabled = false;
- }
- else if (radioButton5.Checked)
- {
- this.label6.Enabled = false;
- this.trackBar3.Enabled = false;
- this.label7.Enabled = false;
- this.radioButton11.Enabled = false;
- this.radioButton9.Enabled = false;
- }
- else if (radioButton8.Checked)
- {
- this.label6.Enabled = true;
- this.trackBar3.Enabled = true;
- this.label7.Enabled = false;
- this.radioButton11.Enabled = false;
- this.radioButton9.Enabled = false;
- }
- else if (radioButton7.Checked)
- {
- this.label6.Enabled = true;
- this.trackBar3.Enabled = true;
- this.label7.Enabled = false;
- this.radioButton11.Enabled = false;
- this.radioButton9.Enabled = false;
- }
- else if (radioButton10.Checked)
- {
- this.label6.Enabled = false;
- this.trackBar3.Enabled = false;
- this.label7.Enabled = true;
- this.radioButton11.Enabled = true;
- this.radioButton9.Enabled = true;
- }
- }
- private void radioButton6_CheckedChanged(object sender, EventArgs e)
- {
- this.refreshRadioStatus();
- }
- private void radioButton5_CheckedChanged(object sender, EventArgs e)
- {
- this.refreshRadioStatus();
- }
- private void radioButton8_CheckedChanged(object sender, EventArgs e)
- {
- this.refreshRadioStatus();
- }
- private void radioButton7_CheckedChanged(object sender, EventArgs e)
- {
- this.refreshRadioStatus();
- }
- private void radioButton10_CheckedChanged(object sender, EventArgs e)
- {
- this.refreshRadioStatus();
- }
- }
- }
|