示例#1
0
 public void EnableGates(ref Gates gate, int threshold, int start, int end)
 {
     gate.Enable         = true;
     gate.ThresholdPixel = threshold;
     gate.StartPixel     = start;
     gate.EndPixel       = end;
 }
示例#2
0
        private void InitialGates()
        {
            gate0       = new Gates();
            gate0.color = Color.Red;
            gate0.Name  = "gate0";

            gate1       = new Gates();
            gate1.color = Color.Blue;
            gate1.Name  = "gate1";

            gate2       = new Gates();
            gate2.color = Color.Green;
            gate2.Name  = "gate2";

            gate3       = new Gates();
            gate3.color = Color.Black;
            gate3.Name  = "gate3";
        }
示例#3
0
        private void StateGate(Gates g, Point p)
        {
            string tmp;

            tmp        = g.MouseState(p);
            MouseState = g.Name + tmp;
            if (tmp == "mid")
            {
                Cursor = Cursors.NoMove2D;
            }
            if (tmp == "start" || tmp == "end")
            {
                Cursor = Cursors.NoMoveHoriz;
            }
            if (tmp == null)
            {
                MouseState = "+";
            }
        }
示例#4
0
        private void RefreshGate(ref Gates gate, Point p)
        {
            if (MouseState.Contains("mid"))
            {
                int width = (gate.EndPixel - gate.StartPixel) / 2;
                gate.StartPixel     = p.X - width;
                gate.EndPixel       = p.X + width;
                gate.ThresholdPixel = p.Y;
            }
            if (MouseState.Contains("start"))
            {
                gate.StartPixel = p.X;
            }
            if (MouseState.Contains("end"))
            {
                gate.EndPixel = p.X;
            }

            float num = Convert.ToSingle(gate.Name.Substring(4));

            GateChanged?.Invoke(new float[] {
                num, gate.Start, gate.End, gate.Threshold
            });
        }