I want to display an IPLimage / MAT (opencv) formats on a MFC picture box in Visual C++
Asked
Active
Viewed 3,963 times
2
-
Picture boxes can only display bitmaps I think. You'll need to convert IPLimage to a bitmap. Do it pixel by pixel. – sashoalm Nov 23 '12 at 14:27
2 Answers
1
Here is a complete solution describing how to display an IplImage in a MCF/C++ form application using OpenCV http://ac-it.pl/display-an-iplimage-in-a-mcfc-form-application-using-opencv

Artur Chudzik
- 11
- 1
0
Picture boxes can only display bitmaps I think. You'll need to convert IPLimage to a bitmap.
Assuming you can first convert IPLimage to a buffer of RGB values, see Creating HBITMAP from memory buffer
Then when you get the HBITMAP, you'll need to load it in the Picture Box. Assuming by picture box you mean a static control, add SS_BITMAP
to its styles, and then load the HBITMAP using
SendMessage(hStatic, STM_SETIMAGE, (WPARAM)IMAGE_BITMAP, (LPARAM)hBitmap);