gpt4 book ai didi

c# - 如何在 ASP.NET 中隐藏 RGB channel 之一?

转载 作者:太空宇宙 更新时间:2023-11-03 14:00:13 25 4
gpt4 key购买 nike

我尝试研究,但似乎在 ASP.NET 中没有解决方案,只有 webforms 等。

例如,我可以为 .jpg 隐藏 RGB channel (比如,只有红色 channel )吗?

最佳答案

using(var bmp = new Bitmap("C:\\temp\\source.jpg"))
{
for (int x = 0; x < bmp.Width; x++)
for (int y = 0; y < bmp.Height; y++)
{
var c = bmp.GetPixel(x, y);
bmp.SetPixel(x, y, Color.FromArgb(c.A, 0, c.G, c.B));
}
bmp.Save("C:\\temp\\target.jpg", ImageFormat.Jpeg);
}

关于c# - 如何在 ASP.NET 中隐藏 RGB channel 之一?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10904343/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com