Home > Back-end >  VC call Matlab engine, VC opened the BMP images, how to give the picture to Matlab engine to perform
VC call Matlab engine, VC opened the BMP images, how to give the picture to Matlab engine to perform

Time:10-10

Part of the code:
Void CMyDlg: : OnFileOpen ()
{
//TODO: Add your command handler code here
Cstrings m_szFilePathName;//image file path
Cstrings m_szFileName;
CFileDialog DLG (true, NULL, NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
_T (" bitmap Files (*. BMP) | *. BMP | | "), NULL);
If (DLG) DoModal ()==IDOK)
{
M_szFileName=DLG. GetFileName ();
M_szFilePathName=DLG. GetPathName ();

CRect the rect.
GetDlgItem (IDC_TuPian1) - & gt; GetWindowRect (& amp; The rect);
//is controls the Width of the rect. Width (), high is the rect Height ();
//MessageBox (the rect. Height () + "" + the rect. Height ());
HBITMAP hand=(HBITMAP) LoadImage (AfxGetInstanceHandle (), m_szFilePathName, IMAGE_BITMAP,
The rect. Width (), the rect. Height (), LR_LOADFROMFILE);
HBITMAP h=((CStatic *) GetDlgItem (IDC_TuPian1)) - & gt; SetBitmap (hand);
//m_pic SetBitmap (hand);

}
The else
return ;
}
Here are VC Matlab engine, how to put the above picture, give below I_rgb=imread (' pl); Read in?
Void CMyDlg: : OnBeiJingFenGe ()
{
//TODO: Add your command handler code here

EngEvalString (ep, "I_rgb=imread (' pl);" );
  • Related