2

I want to display an IPLimage / MAT (opencv) formats on a MFC picture box in Visual C++

sashoalm
  • 75,001
  • 122
  • 434
  • 781
Shanil Jevin
  • 45
  • 1
  • 4
  • 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 Answers2

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

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);
Community
  • 1
  • 1
sashoalm
  • 75,001
  • 122
  • 434
  • 781