I'm trying to do a image processing software and for the moment I'm stuck on this. I've open an image in my first canvas, and now I want to take the image and add some filters on it. Contrast, saturation and so on, and then to see it on the second canvas. But my main problem is that I can't find out how to use pixels from my first canvas and manipulate them. How can I do this the easy way? Thanks.
private void openImage_OnClick(object sender, RoutedEventArgs e)
{
Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
dlg.InitialDirectory = "c:\\";
dlg.DefaultExt = ".jpeg";
dlg.Filter = "Image files (*.png;*.jpg;*.jpeg)|*.png;*.jpg;*.jpeg";
Nullable<bool> result = dlg.ShowDialog();
if (result == true)
{
string filename = dlg.FileName;
ImageBrush brush = new ImageBrush();
brush.ImageSource = new BitmapImage(new Uri(@filename, UriKind.Relative));
CanvasOriginalImage.Background = brush;
}
}