The GrayscaleBitmap class processes a source and converts the image to a grayscale color scheme.
For simplicity, we only process Bgr32 or Bgra32 formatted bitmaps, anything else is converted to one of those formats. Bgr32 and Bgra32 share the same memory layout for the RGB channels.
Inheritance: Microsoft.DwayneNeed.Media.Imaging.ChainedBitmap
コード例 #1
0
        private void ShowGrayscaleBitmap()
        {
            BitmapSource captureScreen = CaptureScreen(this.resultBorder, 96, 96);

            if (captureScreen == null)
            {
                return;
            }

            Grayscale4Bitmap grayscaleBitmap = new Grayscale4Bitmap();

            grayscaleBitmap.Source  = captureScreen;
            this.resultImage.Source = grayscaleBitmap;
        }
コード例 #2
0
        private void ShowGrayscaleBitmap()
        {
            var captureScreen = CaptureScreen(resultBorder, 96, 96);

            if (captureScreen is null)
            {
                return;
            }

            var grayscaleBitmap = new Grayscale4Bitmap {
                Source = captureScreen
            };

            resultImage.Source = grayscaleBitmap;
        }
コード例 #3
0
        private void ShowGrayscaleBitmap()
        {
            BitmapSource captureScreen = CaptureScreen(this.resultBorder, 96, 96);
            if (captureScreen == null)
                return;

            Grayscale4Bitmap grayscaleBitmap = new Grayscale4Bitmap();
            grayscaleBitmap.Source = captureScreen;
            this.resultImage.Source = grayscaleBitmap;
        }