我的项目我想使用EmguCV库,但EmguCV的功能无法处理Bitmap对象,所以我必须将Bitmap转换为其他类型,Intptr是一个选择,但我真不知道如何编码,老乡代码是抽象的,从我的项目是这样的:如何将位图转换为intptr C#
Bitmap bmp = new Bitmap(e.width, e.height,
System.Drawing.Imaging.PixelFormat.Format24bppRgb);
System.Drawing.Imaging.BitmapData data =
bmp.LockBits(new Rectangle(0, 0, e.width, e.height),
System.Drawing.Imaging.ImageLockMode.ReadWrite,
System.Drawing.Imaging.PixelFormat.Format24bppRgb);
int dataLength = e.width * e.height * 3;
Win32.memcpy(data.Scan0, (IntPtr)e.data, (uint)dataLength);
convertBitmapToIntptr(bmp);
我怎么能在这个功能convertBitmapToIntptr(bmp)
代码?
不太确定你在问什么? – 2010-06-03 01:19:02
你在寻找GetHbitmap()吗? http://msdn.microsoft.com/en-us/library/1dz311e4.aspx – 2010-06-03 13:40:31