The following code MAT to HBITMAP but pictures can't show don't know what reason be
BOOL CFaceDemoDlg: : MatToHBitmap (Mat& _mat HBITMAP& _hBmp)
{
//MAT TYPE=(nChannels - 1 + CV_8U) & lt; <3
Int nChannels=(_mat type () & gt;> 3) - CV_8U + 1;
Int iSize=_mat. * _mat cols. Rows * nChannels;
_hBmp=CreateBitmap (_mat. Cols, _mat. Rows, 1, nChannels * 8, _mat. Data);
if (! _hBmp)
{
return FALSE;
}
Return TRUE;
}
CodePudding user response:
Advice is saved as a picture in the OPENCV, open in the MFCCodePudding user response:
Using CreateDIBitmap, lpbmi Settings must be in agreement and the format of the MatCodePudding user response:
I am on the net to collect the Mat HBITMAP code, then show a blank as youCodePudding user response:
https://blog.csdn.net/youyingbo/article/details/80688202