Пример #1
0
 private void FillFuncContainer()
 {
     funcContainer = new Dictionary <string, Action <BitmapData, int> >
     {
         { "blackwhite", (data, bitsPerPixel) => ConvertToBlackWhite.Proceed(data, bitsPerPixel) },
         { "horizontalflip", (data, bitsPerPixel) => FlipHorizontal.Proceed(data, bitsPerPixel) },
         { "increasecontrast", (data, bitsPerPixel) => IncreaseContrast.Proceed(data, bitsPerPixel) },
         { "increasebrightness", (data, bitsPerPixel) => IncreaseBrightness.Proceed(data, bitsPerPixel) },
         { "increasesaturation", (data, bitsPerPixel) => IncreaseSaturation.Proceed(data, bitsPerPixel) }
     };
 }
        private void segmentTextToolStripMenuItem_Click(object sender, EventArgs e)
        {
            IOperation operation = new Grayscale();

            m_image = operation.Apply(m_image);

            operation = new IncreaseContrast();
            m_image   = operation.Apply(m_image);

            operation = new LocalThreshold(10, 10);
            m_image   = operation.Apply(m_image);

            pictureBox1.Image = m_image.ExportBitmap();
        }