opencv 实时显示当前时间

CvFont font;  
cvInitFont(&font,CV_FONT_HERSHEY_COMPLEX, 1, 1, 0, 2, CV_AA); 
cvPutText(m_Frame, "HELLO!" , cvPoint(50, 50), &font, CV_RGB(255,255,255));

//m_vieoProtery=cvGetCaptureProperty(m_Video,CV_CAP_PROP_FRAME_WIDTH);

不支持中文叠加。

实时显示时间:
	CvFont font;  
	CTime m_StartTime1 = CTime::GetCurrentTime();
	CString filename = m_StartTime1.Format("%Y-%m-%d %H:%M:%S" );
			
	wchar_t* wCharString = filename.GetBuffer(filename.GetLength()+1); 
	size_t origsize = wcslen(wCharString) + 1; 
	size_t convertedChars = 0; 
	char *CharString; 
	CharString=new char(origsize); 
	wcstombs_s(&convertedChars, CharString, origsize, wCharString , _TRUNCATE); 

	cvInitFont(&font,CV_FONT_HERSHEY_COMPLEX, 1, 1, 0, 2, CV_AA); 
	cvPutText(m_Frame, CharString,cvPoint(50, 50), &font, CV_RGB(255,255,255));
		

你可能感兴趣的:(Opencv)