コード例 #1
0
        public FormImage(int mode, Function function, FormFunction formFunction, int baseSn)
        {
            GC.Collect();
            this.mode         = mode;
            this.function     = function;
            this.formFunction = formFunction;
            this.baseSn       = baseSn;
            if (mode == 1)//mode1: imageCut
            {
                Rectangle rect =
                    new Rectangle(R8.stringToInt(FormMain.r8.variables[function.parameters.ElementAt(1).variableSn].value)
                                  , R8.stringToInt(FormMain.r8.variables[function.parameters.ElementAt(2).variableSn].value)
                                  , R8.stringToInt(FormMain.r8.variables[function.parameters.ElementAt(3).variableSn].value)
                                  , R8.stringToInt(FormMain.r8.variables[function.parameters.ElementAt(4).variableSn].value));
                SizeableArea sa = new SizeableArea(rect, Color.Blue);
                listSQ.Add(sa);
            }
            else if (mode == 2)  //mode2: 多個 rect
            {
                inputRectArrayString(FormMain.r8.variables[function.parameters.ElementAt(baseSn).variableSn].value);
            }
            InitializeComponent();
            if (mode != 0)
            {
                setToolStripMenuItem.Visible = true;
            }

            if (mode == 3 || mode == 4)
            {
                rotateValue                 = R8.stringToDouble(FormMain.r8.variables[function.parameters.ElementAt(baseSn).variableSn].value);
                labelRotate.Visible         = true;
                numericUpDownRotate.Visible = true;
                numericUpDownRotate.Value   = (decimal)rotateValue;

                if (mode == 4)
                {
                    Rectangle rect =
                        new Rectangle(R8.stringToInt(FormMain.r8.variables[function.parameters.ElementAt(baseSn + 1).variableSn].value)
                                      , R8.stringToInt(FormMain.r8.variables[function.parameters.ElementAt(baseSn + 2).variableSn].value)
                                      , R8.stringToInt(FormMain.r8.variables[function.parameters.ElementAt(baseSn + 3).variableSn].value)
                                      , R8.stringToInt(FormMain.r8.variables[function.parameters.ElementAt(baseSn + 4).variableSn].value));
                    SizeableArea sa = new SizeableArea(rect, Color.Blue);
                    listSQ.Add(sa);
                }
            }
        }