惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - Franky
Apple Machine Learning Research
Apple Machine Learning Research
月光博客
月光博客
Vercel News
Vercel News
Recent Announcements
Recent Announcements
B
Blog RSS Feed
Y
Y Combinator Blog
M
MIT News - Artificial intelligence
MongoDB | Blog
MongoDB | Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
雷峰网
雷峰网
D
Docker
Jina AI
Jina AI
IT之家
IT之家
人人都是产品经理
人人都是产品经理
L
LangChain Blog
G
Google Developers Blog
Google DeepMind News
Google DeepMind News
MyScale Blog
MyScale Blog
博客园 - 叶小钗
The GitHub Blog
The GitHub Blog
The Cloudflare Blog
A
About on SuperTechFans
Hugging Face - Blog
Hugging Face - Blog

博客园 - <林海>

JavaScript中Array 对象相关的几个方法 Javascript总结 sql时间格式转换问题 Transact SQL 常用语句以及函数 C#读取硬盘序列号 C#注册表操作类 Windows API函数大全 windows运行命令详解 Javascript String 对象增强 VS.NET 2003 命名规范 .NET Remoting 实现分布式数据库查询 ASP.NET细节 JS刷新页面问题 javascript 列出本地某个目录下所有的文件 JavaScript每隔一段时间重新加载一下这个JS文件 JavaScript高效地检查每个值是否有重复 Javascript 构造endwith方法 用javascript判断某文件是否存在于本地机器的某路径下 JavaScript语法——style.display 属性
高效取得图片数据GetImgByte,返回结果数组和像素一一对应
<林海> · 2011-03-08 · via 博客园 - <林海>

     // 性能最高,其数组和像素一一对应   
        public static byte[] GetImgByte(this Bitmap bmp)
        {
            BitmapData bitmapData = bmp.LockBits(new System.Drawing.Rectangle(new Point(0, 0), bmp.Size),
                ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);
            byte[] res = new byte[bitmapData.Stride * bitmapData.Height];

            IntPtr Ptr = bitmapData.Scan0;
            System.Runtime.InteropServices.Marshal.Copy(Ptr, res, 0, res.Length);

            bmp.UnlockBits(bitmapData);
            return res;
        }