Home > Software engineering >  Error C2061: syntax errors: identifier "IplImage"
Error C2061: syntax errors: identifier "IplImage"

Time:11-22

Rookie help specific program
Void CzqtestopenfileDlg: : OnBnClickedButton1 ()
{
//TODO: add the control notification handler code
CFileDialog OpenFile (TRUE, _T (" *. BMP "), NULL, OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY, _T (" image files (*. BMP. | * *.jpg). BMP; *.jpg | All Files (*. *) | *. * | | "), NULL);
Char title []={" open image "};//set the title of the dialog
OpenFile. M_ofn. LpstrTitle=title;
The UpdateData (FALSE);
If (OpenFile DoModal ()==IDOK)
{
FilePath.=OpenFile GetPathName ();
The string filename=CT2A (filePath. GetBuffer ());
Imageleft=imread (filename);
IplImage * iplimg;
* iplimg=IplImage (imageleft);
ShowPicture (IDC_STATIC, iplimg);
}
The else
{
MessageBox (" did not load the picture ", "title");
}

}
Void CzqtestopenfileDlg: : ShowPicture (int nID, IplImage * Image)
{
The CDC * pDC=GetDlgItem (nID) - & gt; GetDC ();//according to the ID window to acquire the associated with the window context pointer
HDC HDC=pDC - & gt; GetSafeHdc ();//access device context handle
CRect the rect.//rectangle class
GetDlgItem (nID) - & gt; GetClientRect (& amp; The rect);//get box1 client area
CvvImage cimg;
Cimg. CopyOf (Image, 3);
Cimg. DrawToHDC (HDC, & amp; The rect);
//output image
The ReleaseDC (pDC);
Cimg. Destroy ();
//destruction
}

CodePudding user response:

CImage or GDI++?

CodePudding user response:

I use opencv, but in ShowPicture (int nID, IplImage * Image) in the second parameter display error C2061

CodePudding user response:

Didn't include OPENCV header files

CodePudding user response:

The corresponding class header files to include in the project

CodePudding user response:

Include links to the corresponding header file, the corresponding lib file

CodePudding user response:

Header files are included

CodePudding user response:

IplImage * iplimg;
* iplimg=IplImage (imageleft);

Pointer to the function name with the same name?

CodePudding user response:

Opencv several? CvvImage already cancelled?
https://blog.csdn.net/youyingbo/article/details/80688202
  • Related