Skip to content

Instantly share code, notes, and snippets.

@MhdSyrwan
Created April 14, 2013 12:12
Show Gist options
  • Save MhdSyrwan/5382486 to your computer and use it in GitHub Desktop.
Save MhdSyrwan/5382486 to your computer and use it in GitHub Desktop.
An Image Processing Helper
using System;
namespace System
{
namespace Drawing
{
public static class Processing
{
public static void Process (this Bitmap img, Func<int,int,Color,Color> action)
{
for (int x = 0; x < img.Width; x++) {
for (int y = 0; y < img.Height; y++) {
img.SetPixel (x, y, action (x, y, img.GetPixel (x, y)));
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment