資源簡介
opencv中Mat轉換成內存數據的jpeg格式,以及顯示在mfc的界面中
代碼片段和文件信息
#include?“stdafx.h“
#include?“MatShowAndJPG2Mat.h“
int?ShowJPG(unsigned?char?*pDataint?iDataLenCWnd?*pwnd)
{
//char?strTmp[MAX_PARA_LEN];
CString?strPath;
IStream?*pStm;??
IPicture?*pPic;
OLE_XSIZE_HIMETRIC?hmWidth;????
OLE_YSIZE_HIMETRIC?hmHeight;????
CDC*?pDC;
// int?s32PicWidth;
// int?s32PicHeight;
int?x?=?0;
int?y?=?0;
//CFileStatus?fstatus;?
//CFile?file;?
LPVOID?pvData;
ULONGLONG?cb?=?iDataLen;??
????HGLOBAL?hGlobal;
/************************************************
step2:?打開?jpeg?文件?m_apFileName[nId]
*************************************************/
/* strPath.Format(“C:/Users/teng/Pictures/4.jpg“);
if?(!file.Open(strPathCFile::modeRead))??
{??
AfxMessageBox(“file?has?not?found“);
return?-1;??
}??
if?(!file.GetStatus(st
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????5465??2009-08-28?23:34??MatShowAndJPG2Mat\cderror.h
?????文件???????6443??2003-11-04?06:53??MatShowAndJPG2Mat\cdjpeg.h
?????文件???????1605??2015-07-29?19:44??MatShowAndJPG2Mat\jconfig.h
?????文件??????18349??2015-07-30?18:06??MatShowAndJPG2Mat\jdct.h
?????文件??????14884??2012-04-29?22:35??MatShowAndJPG2Mat\jerror.h
?????文件???????3341??1994-04-02?00:29??MatShowAndJPG2Mat\jinclude.h
?????文件???????8428??1997-08-04?04:58??MatShowAndJPG2Mat\jmemsys.h
?????文件??????15371??2013-09-17?17:20??MatShowAndJPG2Mat\jmorecfg.h
?????文件??????17710??2013-03-13?01:26??MatShowAndJPG2Mat\jpegint.h
?????文件??????50467??2015-09-15?03:36??MatShowAndJPG2Mat\jpeglib.h
?????文件????????410??2016-01-17?17:04??MatShowAndJPG2Mat\jversion.h
?????文件?????829338??2017-03-30?11:41??MatShowAndJPG2Mat\libjpeg.lib
?????文件??????10784??2017-05-31?15:50??MatShowAndJPG2Mat\MatShowAndJPG2Mat.cpp
?????文件????????444??2017-05-31?09:42??MatShowAndJPG2Mat\MatShowAndJPG2Mat.h
?????文件???????9784??2013-09-13?22:10??MatShowAndJPG2Mat\transupp.h
?????目錄??????????0??2018-05-17?16:49??MatShowAndJPG2Mat
-----------?---------??----------?-----??----
???????????????992823????????????????????16
評論
共有 條評論