Torna al Thread
public static Bitmap FastNullTransform(Image inputImage)
{
Bitmap outputBitmap = new Bitmap(inputImage.Width, inputImage.Height);
ImageAttributes attributes = new ImageAttributes();
ColorMatrix colorMatrix = new ColorMatrix(new float[][] {
new float[] {1, 0, 0, 0, 0},
new float[] {0, 1, 0, 0, 0},
new float[] {0, 0, 1, 0, 0},
new float[] {0, 0, 0, 1, 0},
new float[] {0, 0, 0, 0, 1}
}
);
attributes.SetColorMatrix(colorMatrix);
Graphics outputGraphics = Graphics.FromImage(outputBitmap);
Rectangle rectInput = new Rectangle(0, 0, inputImage.Width, inputImage.Height);
outputGraphics.DrawImage(inputImage, rectInput, 0, 0, inputImage.Width, inputImage.Height, GraphicsUnit.Pixel, attributes);
outputGraphics.Dispose();
return outputBitmap;
}