private void hueModificationToolStripMenuItem_Click(object sender, EventArgs e)
        {
            HueModifier hm = new HueModifier(180);

            hueImage          = hm.Apply(originalImage);
            pictureBox5.Image = hueImage;
        }
示例#2
0
        public Bitmap GetNewFrame(Bitmap source)
        {
            var newFrame = _hueModifier.Apply(source);

            source.Dispose();
            return(newFrame);
        }
        private void hueToolStripMenuItem_Click(object sender, EventArgs e)
        {
            HueModifier gb = new HueModifier();

            newImg            = gb.Apply(orgImg);
            pictureBox5.Image = newImg;
        }
示例#4
0
        public Bitmap ToHueModifier(Bitmap Im)
        {
            AForge.Imaging.Filters.HueModifier Img = new HueModifier();
            Bitmap bmImage = AForge.Imaging.Image.Clone(new Bitmap(Im), PixelFormat.Format24bppRgb);

            return(Img.Apply(bmImage));
        }
示例#5
0
        private void Hue_ValueChanged(object sender, RoutedPropertyChangedEventArgs <double> e)
        {
            HueLabel.Content = Hue.Value;
            hue = (int)Hue.Value;

            if (mainPhoto != null)
            {
                hm = new HueModifier(hue);
                System.Drawing.Bitmap tmp = hm.Apply((System.Drawing.Bitmap)mainPhoto.Clone());
                //BitmapImage tmpBmpIs = ToBitmapImage(tmp);

                Photography.Source = ToBitmapImage(tmp);

                UpdateHistograms(tmp);
                UpdateChannelPreviews(tmp);
            }
        }
示例#6
0
文件: UsbCam.cs 项目: Krl1/UP_L
        private void DisplayCapturedPicture(object sender, NewFrameEventArgs eventArgs)
        {
            Bitmap bitmap = new Bitmap(eventArgs.Frame, new Size(cameraPictureBox.Width, cameraPictureBox.Height));
            BrightnessCorrection brightnessCorrection = new BrightnessCorrection(Brightness);
            ContrastCorrection   contrastCorrection   = new ContrastCorrection(Contrast);
            SaturationCorrection saturationCorrection = new SaturationCorrection(Saturation * 0.1f);
            HueModifier          hueModifier          = new HueModifier(Hue);

            bitmap = brightnessCorrection.Apply((Bitmap)bitmap.Clone());
            bitmap = contrastCorrection.Apply((Bitmap)bitmap.Clone());
            bitmap = saturationCorrection.Apply((Bitmap)bitmap.Clone());
            bitmap = hueModifier.Apply((Bitmap)bitmap.Clone());

            if (connectedCameraIsRecording)
            {
                videoWriter.WriteVideoFrame(bitmap);
            }

            cameraPictureBox.Image = bitmap;
        }
示例#7
0
        public Tuple <Bitmap, Json> CreateImage(double factor)
        {
            var target = new Bitmap(_screenWidth, _screenHeight, _pixelFormat);

            target.SetResolution(_horizontalResolution, _verticalResolution);
            var graphics = Graphics.FromImage(target);

            graphics.CompositingMode = CompositingMode.SourceOver;

            Json json = new Json();

            json.angle = 0;
            json.type  = "Collection pop";
            for (var i = 0; i < _nbX; i++)
            {
                for (var j = 0; j < _nbY; j++)
                {
                    var path = _faces.ElementAt(_rndCreateImage.Next(0, _faces.Count() - 1));
                    json.addItem(path, "Tête " + (i + 1) + "-" + (j + 1));

                    var face = FastLoad(path);
                    if (face != null)
                    {
                        try
                        {
                            var   filter = new HueModifier(_rndCreateImage.Next(0, 359));
                            float width  = (float)(face.Width / factor);
                            float height = (float)(face.Height / factor);
                            graphics.DrawImage(filter.Apply(new Bitmap(face)), _posX + i * width, _posY + j * height, width, height);
                        }
                        catch { }
                    }
                }
            }

            return(new Tuple <Bitmap, Json>(target, json));
        }
示例#8
0
        private void hueModifierToolStripMenuItem_Click(object sender, EventArgs e)
        {
            HueModifier hue = new HueModifier();

            pictureBox2.Image = hue.Apply((Bitmap)pictureBox1.Image);
        }
示例#9
0
 public Bitmap Apply(Bitmap input)
 {
     _filter.Hue = _param;
     return(_filter.Apply(input));
 }