I need to convert Gdiplus::Bitmap to cv::Map format. I\'m using this code to do this:
Gdiplus::Bitmap* enhanced = ...; // some Bitmap
Gdiplus::BitmapData bmp
if you're constructing a cv::Mat from your Bitmap, you will have to use
cv::imshow("w", imageMap);
to draw it.
again, the address of a cv::Mat is not the same as an IplImage* required by cvShowImage();
(btw, you should get rid of all other deprecated c-api calls, too.)
also, be a bit careful, a Mat constructed the way you do, has a borrowed pointer to the pixels.
i don't know anything about gdi+, but if that pointer goes out of scope or gets invalid when you call enhanced->UnlockRect (or what it was called), you will need to do
Mat safeImg = imageMap.clone();
to achieve a 'deep' copy.