コード例 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (OpenFileTestLoadImage.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                // begin Benchmark
                Benchmark.Start();

                // load image into Picture Box
                picImage.Load(OpenFileTestLoadImage.FileName);
                labelImageWidth.Text  = picImage.Image.Width.ToString();
                labelImageHeight.Text = picImage.Image.Height.ToString();
                labelImageMode.Text   = picImage.Image.PixelFormat.ToString();
                // new AshvImage from bitmap object
                imageBitmap  = new Bitmap(picImage.Image);
                imageAnalyse = new AhsvImage(imageBitmap);

                // end Benchmark
                Benchmark.End();
                labelBenchmark.Text = Benchmark.Span.ToString();

                // sample
                //string sample = imageAnalyse.ImageSample(PixelHandler.Color_V, 50, 50, 60, 60);
                //MessageBox.Show(sample);
            }
        }
コード例 #2
0
 public SlicedImage(string name, Coord position, Dimension dimension, AhsvImage imageContent = null)
 {
     // update iscontaining image
     IsContainingImage = (imageContent == null) ? false : true;
     // set fields
     Name         = name;
     ImageContent = imageContent;
     Size         = dimension;
     Position     = position;
 }
コード例 #3
0
        /**
         * CreateSlice
         * Add a new slice: with at least Coord and Dimension
         */
        public void CreateSlice(Coord position, Dimension dimension, string name = "", AhsvImage image = null)
        {
            // get default name or string passed
            string sliceName = (name.Length < 2) ? "new Slice" + Slices.Count() : name;

            // ahsvImage can be null;

            Slices.Add(new SlicedImage(sliceName, position, dimension, image));
        }