private static Bitmap bitmap = null; /// <summary> /// 图片隐写术 /// </summary> private static void YinXieShu() { bitmap = new Bitmap("145303100168558.png"); for (int x = 0; x < bitmap.Width; x++) { for (int y = 0; y < bitmap.Height; y++) { Color pixelColor = bitmap.GetPixel(x, y); ////像素点颜色的 Alpha 值 //byte alpha = pixelColor.A; ////颜色的 RED 分量值 byte red = pixelColor.R; ////颜色的 GREEN 分量值 //byte green = pixelColor.G; ////颜色的 BLUE 分量值 //byte blue = pixelColor.B; bitmap.SetPixel(x, y, Color.Black); if (red % 2 == 1) { bitmap.SetPixel(x, y, Color.Red); } } } bitmap.Save("r.png"); }