我的項目我想使用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