打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
C# 的高效方法取得图片的像素区数据
C# 的高效方法取得图片的像素区数据。
// Lock the bitmap's bits. Rectangle rect = new Rectangle(0, 0, image.Width, image.Height);BitmapData bmpData = image.LockBits(rect, ImageLockMode.ReadWrite, image.PixelFormat);// Get the address of the first line.IntPtr ptr = bmpData.Scan0;// Declare an array to hold the bytes of the bitmap.int bytes = Math.Abs(bmpData.Stride) * image.Height;byte[] rgbValues = new byte[bytes];// Copy the RGB values into the array.Marshal.Copy(ptr, rgbValues, 0, bytes);// Unlock the bits.image.UnlockBits(bmpData);return rgbValues;

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
C#数字图像处理的3种方法
C#数字图像处理时注意图像的未用区域
GDI 入门(C#高速处理版本)
数字图片处理算法
C#图片处理常见方法性能比较
c# 24位图像转8位灰度图像(数组方式)
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服