MFC Programming

Hi
I am just trying to develop an interface to load a picture from a file using opencv. I created an SDI using the visual studio MFC. My main problem is that I will like to reduce the size of the image loaded, as well as make it fit in the window that I created using the MFC, so that the image can appear next to the control buttons on “window1”. This is the little code I have.
IplImage* img = cvLoadImage("C:\\Users\\kevin\\Pictures\\101_FUJI\\DSCF1404.JPG");
if(!img)
{
MessageBox(L"Could not load image");
}
//display image
cvNamedWindow("window1:",0);//CV_WINDOW_AUTOSIZE
cvResizeWindow("window1",420,240);
cvShowImage("window1:",img);

cvWaitKey(0);

//free resources
cvDestroyWindow("Image:");
cvReleaseImage(&img);
You use opencv when mfc already has a CImage class which is a wrapper around GDI+ ...
Topic archived. No new replies allowed.