位图图像保存在C#中的灰度图像 [英] save bitmap image as grayscale image in C#
问题描述
这是我的位图代码
Bitmap b = new Bitmap(columns, rows, PixelFormat.Format24bppRgb);
BitmapData bmd = b.LockBits(new Rectangle(0, 0, columns, rows), ImageLockMode.ReadWrite, b.PixelFormat);
我怎么可以这样保存为灰度图像?
How can i save this as a grayscale image ?
好IAM特别感兴趣的储蓄部分。我该如何将它保存为一个文件?
Well iam specifically interested in the saving part. How do i save it as a file ?
推荐答案
有在谷歌许多环节
像
的 https://web.archive.org/web/20110219113117/http://www.switchonthecode.com/tutorials/ CSHARP教程 - 转换-A-彩色图像到灰度(WebArchive断开的链接)
https://web.archive.org/web/20110219113117/http://www.switchonthecode.com/tutorials/csharp-tutorial-convert-a-color-image-to-grayscale (WebArchive for broken link)
或
的https:/ /web.archive.org/web/20120707003826/http://www.dreamincode.net/code/snippet2570.htm (WebArchive断开的链接)
https://web.archive.org/web/20120707003826/http://www.dreamincode.net/code/snippet2570.htm (WebArchive for broken link)
这篇关于位图图像保存在C#中的灰度图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!