Kinect Winform程序中 彩色图像帧转化为Bitmap
2014-04-30 10:16
441 查看
public Bitmap GetBitmap(ColorImageFrame frame) { byte[] data = new byte[frame.PixelDataLength]; frame.CopyPixelDataTo(data); Rectangle rect = new Rectangle(0, 0, frame.Width, frame.Height); Bitmap bitmap = new Bitmap(frame.Width, frame.Height); BitmapData bd = bitmap.LockBits(rect, ImageLockMode.ReadWrite, bitmap.PixelFormat); IntPtr ptr = bd.Scan0; System.Runtime.InteropServices.Marshal.Copy(data, 0, ptr, data.Length); bitmap.UnlockBits(bd); return bitmap; }
相关文章推荐
- 认识redis.conf文件
- 极大似然估计的朴素理解
- C#开发Android的tabhost使用+侧拉抽屉
- Qt利用qrc文件添加图标资源
- 源对象的基类
- IOPS和传输带宽
- sysfs API总结
- 微软有那么多牛人,为什么 IE 却做得不够好?
- Cocos2d-x3.0 iOS 一键编译多个target并打包ipa。
- Linux 字符设备驱动简单总结(转)
- ArcGIS Server 10.1发布要素服务时遇到的数据库注册问题总结 (二)
- intellij idea 修改背景保护色&&修改字体&&快捷键大全
- Cocoapods error: “Pull is not possible because you have unmerged files.”
- soap 和 com_dotnet
- iOS:xcode Overview3 && structure & template & relationship & target
- phpMyBackupPro定时备份
- ubuntu下使用自带的openJDK查看java源代码
- 项目规划阶段-甲方要求乙方在项目周例会上应该陈述的事情
- JDK升级1.4 -1.5
- 跟我一起学Makefile