コード例 #1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            if (_currentImage == null)
            {
                return;
            }


            int inputNumber = int.Parse(NumberInput.Text);

            Stopwatch performanceCounter = new Stopwatch();

            performanceCounter.Start();

            CanvasARGB canvas = Get_ProgressOrOrigInput();
            //for (int i = 0; i < 28000; i += 4)
            //{
            //    canvas.Data[i] = 0;
            //    canvas.Data[i + 1] = 255;
            //    canvas.Data[i + 2] = 0;
            //    canvas.Data[i + 3] = 255;
            //}


            CanvasPixel canvasPixel = CanvasPixel.CreateBitmpaFromCanvas(canvas);

            canvasPixel.TransformToInterleaveRGB();
            BasicOperation.PixelFilter2(canvasPixel, inputNumber);
            //canvasPixel.
            //BasicOperation.BlackWhite(canvasPixel);

            _lastImage = CanvasPixel.CreateBitmpaFromCanvas(canvasPixel);



            //BitmapSource bs = CanvasARGB.CreateBitmpaFromCanvas(canvas);

            //_originalImage = bs;
            //byte [] array = BitmapToArray(_originalImage);

            performanceCounter.Stop();

            Helper_SetAppTitle(string.Format("{0,000} s", performanceCounter.Elapsed.TotalSeconds));

            ShowImage(false);
            //RenderTargetBitmap.Create( rtb
            //textBox1.Text = ofd.FileName;
        }