dans mon projet Je veux utiliser EmguCV lib, mais la fonction d'EmguCV ne peut pas traiter l'objet Bitmap, donc je dois convertir Bitmap en un autre type, Intptr est un choix mais je ne sais vraiment pas comment le code, le code boursier est abstrait de mon projet comme celui-ci:comment convertir bitmap en intptr en 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);
Comment puis-je code dans cette fonction convertBitmapToIntptr(bmp)
?
pas tout à fait sûr de ce que vous demandez? –
Êtes-vous à la recherche de GetHbitmap()? http://msdn.microsoft.com/en-us/library/1dz311e4.aspx –