示例#1
0
        private void C_Zoom_SelectedIndexChanged(object sender, EventArgs e)
        {
            Double zoom = Double.Parse(C_Zoom.SelectedValue.ToString());

            originalPB.Image = Scala.Zoom(imgOriginal, zoom);
            RGBChannelChanged();
        }
示例#2
0
    public PhysicsView()
    {
        InitializeComponent();

        _font  = new Font("Arial", 9, GraphicsUnit.Pixel);
        _radar = new Radar {
            Position = new Vector(25, 100), Radius = 20, RealRadius = 100
        };
        _scala = new Scala {
            Size = new System.Drawing.Size(500, 500), Font = _font
        };
    }
示例#3
0
 private void Action_Undo()
 {
     if (imageList.Count > 1)
     {
         imageList.Remove(imageList.Last());
         imgPreview = imageList.Last();
         Bitmap image = new Bitmap(imgPreview);
         Bitmap rgb   = RGBChannel.build(image, RChannel, GChannel, BChannel);
         Double zoom  = Double.Parse(C_Zoom.SelectedValue.ToString());
         previewPB.Image = Scala.Zoom(rgb, zoom);
         GC.Collect();
         B_RefHis.Visible = true;
     }
 }
示例#4
0
        private void RGBChannelChanged()
        {
            Bitmap image = new Bitmap(imgPreview);
            Bitmap rgb   = RGBChannel.build(image, RChannel, GChannel, BChannel);
            Double zoom  = Double.Parse(C_Zoom.SelectedValue.ToString());

            previewPB.Image = Scala.Zoom(rgb, zoom);
            //imgPreview = previewPB.Image;
            //drawHistogram();
            if (imageList.Count == 15)
            {
                imageList.RemoveAt(0);
            }
            imageList.Add(new Bitmap(imgPreview));
            GC.Collect();
        }
示例#5
0
        private void B_ScalaApply_Click(object sender, EventArgs e)
        {
            try
            {
                int newWidth  = Convert.ToInt32(T_Width.Text);
                int newHeight = Convert.ToInt32(T_Height.Text);

                if (newHeight > 0 && newWidth > 0)
                {
                    Bitmap image = new Bitmap(imgPreview);
                    Bitmap scala = Scala.build(image, newWidth, newHeight);
                    imgPreview = scala;
                    RGBChannelChanged();
                    B_RefHis.Visible = true;
                }
                else
                {
                    MessageBox.Show("New dimensions cannot be zero for scaling!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex) {
                MessageBox.Show("New dimensions cannot be zero for scaling!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="eventSubscription">Data of the event to listen to</param>
 public PositionEventListener(Scala.Core.EventSubscription eventSubscription)
     : base(eventSubscription)
 {
 }
示例#7
0
    public virtual ExitCode run()
    {
        if (inPlayground) {
          var scala = file != null ? new Scala(file, arguments): new Scala(dir, arguments);
          return scala.run();
        } else if (inTest) {
          return runTest();
        } else {
          //var options = new List<String>();
          //options.Add("-deprecation");
          //options.Add("-Yreify-copypaste");
          //Func<String> readArguments = () => Console.readln(prompt: "Lift", history: String.Format("lift {0}", root.FullName));
          //options.Add("-e \"scala.reflect.mirror.reify{" + (arguments.Count > 0 ? arguments.ToString() : readArguments()) + "}\"");
          //return Console.batch("scala " + String.Join(" ", options.ToArray()));

          // var root = new DirectoryInfo(project + @"\sandbox\");
          // var files = root.GetFiles("*.scala", SearchOption.AllDirectories).ToList();
          // if (files.Count == 0) {
          //   println("error: nothing to run");
          //   return -1;
          // } else if (files.Count == 1) {
          //   var toRun = files[0];
          //   println("running {0}", toRun.FullName);
          //   var scala = new Scala(toRun, arguments);
          //   return scala.run();
          // } else {
          //   println("error: command is ambiguous");
          //   files.Take(5).ToList().ForEach(file1 => println("    " + file1));
          //   if (files.Count > 5) println("    ... " + (files.Count - 5) + " more");
          //   return -1;
          // }
          var dir = new DirectoryInfo(project + @"\sandbox");
          var scala = new Scala(dir, arguments);
          return scala.run();

          //return Console.batch("partest files\\pos\\t1693.scala", home: project);
        }
    }
示例#8
0
        public List <Scala> GetScala()
        {
            Scala s = new Scala();

            return(s.getScala());
        }
 public SensorDataEventListener(Scala.Core.EventSubscription eventSubscription)
     : base(eventSubscription)
 { }