private void hueModificationToolStripMenuItem_Click(object sender, EventArgs e) { HueModifier hm = new HueModifier(180); hueImage = hm.Apply(originalImage); pictureBox5.Image = hueImage; }
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; }
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)); }
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); } }
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; }
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)); }
private void hueModifierToolStripMenuItem_Click(object sender, EventArgs e) { HueModifier hue = new HueModifier(); pictureBox2.Image = hue.Apply((Bitmap)pictureBox1.Image); }
public Bitmap Apply(Bitmap input) { _filter.Hue = _param; return(_filter.Apply(input)); }