如何在 C# 中以像素级别操作图像 [英] How to manipulate images at the pixel level in C#

查看:28
本文介绍了如何在 C# 中以像素级别操作图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在 C# 中以像素级别操作图像?

How do I manipulate images at the pixel level in C#?

我需要能够分别读取/修改每个位图像素 RGB 值.

I need to be able to read/modify each bitmap pixel RGB values separately.

如果提供代码示例,我们将不胜感激.

A code sample would be appreciated.

推荐答案

如果你想要速度,那就LockBits.请在此处查看 Bob Powell 的精彩演练.如果您只想编辑一些,那么 GetPixel/SetPixel 应该做你想做的.

If you want speed, then LockBits. See here for a good walkthrough by Bob Powell. If you just want to edit a few, then GetPixel/SetPixel should do what you want.

这篇关于如何在 C# 中以像素级别操作图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆