Exemplo n.º 1
0
        private void separateChannelsButton_Click(object sender, EventArgs e)
        {
            if (programData.loadedImage == null)
            {
                return;
            }

            YCbCrSeparateImage yCbCrSeparateImage = new YCbCrSeparateImage();

            List <Image> separatedChannelsImages = yCbCrSeparateImage.SeparateChannels(programData.loadedImage);

            firstChannelPictureBox.Image  = ImageAlgorithms.ResizeImage(separatedChannelsImages[0], firstChannelPictureBox.Width, firstChannelPictureBox.Height);
            secondChannelPictureBox.Image = ImageAlgorithms.ResizeImage(separatedChannelsImages[1], secondChannelPictureBox.Width, secondChannelPictureBox.Height);
            thirdChannelPictureBox.Image  = ImageAlgorithms.ResizeImage(separatedChannelsImages[2], thirdChannelPictureBox.Width, thirdChannelPictureBox.Height);
        }
Exemplo n.º 2
0
        private void LoadImageButton_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.Filter = "JPG Files|*.jpg|PNG Files|*.png|All Files|*.*";
            Stream fileStream = null;

            if (openFileDialog.ShowDialog() == DialogResult.OK && (fileStream = openFileDialog.OpenFile()) != null)
            {
                string fileName = openFileDialog.FileName;
                programData.loadedImage     = Image.FromFile(fileName);
                programData.resizedImage    = ImageAlgorithms.ResizeImage(programData.loadedImage, loadedImagePictureBox.Width, loadedImagePictureBox.Height);
                loadedImagePictureBox.Image = programData.resizedImage;
            }
        }