摘要:
1 cv::Mat cv::Mat是一个n维矩阵类,声明在中。class CV_EXPORTS Mat{public: //a lot of methods …/*! includes several bit-fields: - the magic signature - continuity flag - depth - number of channels */ int flags; //! the matrix dimensionality, >= 2 int dims; //! ... 阅读全文
摘要:
string类的构造函数:string(const char *s); //用c字符串s初始化string(int n,char c); //用n个字符c初始化string类的字符操作:const char &operator[](int n)const;const char &at(int n)const;char &operator[](int n);char &at(int n);operator[]和at()均返回当前字符串中第n个字符的位置,但at函数提供范围检查,当越界时会抛出out_of_range异常,下标运算符[]不提供检查访问。const c 阅读全文
摘要:
//MDLL.h#include "If.h"typedef struct _SS{ int a; int b;}SS;class CMDLL :public IfC{public: CMDLL(void); int a() { SS s; x=30; s.a=10; return s.a; } int b() { return 20; } int hh;};//Fa.h#include "If.h"class MDLL_API CFa{public:CFa(void);~C... 阅读全文
摘要:
在头文件中声明函数例如 afx_msg void onNum(UINT uID)在.cpp文件中添加函数体 void CCalculatorDlg::OnNum(UINT uID) { UINT index=uID-IDC_NUM_0; CString num; num.Format(_T("%d"),index); AfxMessageBox(num); }添加消息映射 ON_CONTROL_RANGE(BN_CLICKED,IDC_NUM_0,IDC_NUM_9,OnNum) 第一个参数 事件 第二个参数 控件的第一个id 第三个参数 空间的最后一个id 第四个参... 阅读全文
摘要:
int maxlen=1024*1024; std::vector<byte> buf; FILE* f= fopen( "c:/f.jpg", "rb" ); string signature(maxlen, ' '); maxlen = fread( &signature[0], 1, maxlen, f ); fclose(f); buf.resize(maxlen); signature = signature.substr(0, maxlen); memcpy(&buf[0],&signatu 阅读全文
摘要:
stdafx.h 加入#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"") 阅读全文
摘要:
#include "stdafx.h"#include <cv.h> #include <highgui.h> IplImage *Image1; CvPoint PointArray1[6]; CvPoint PointArray2[4]; CvScalar Color; int PolyVertexNumber; int Shift; int main() { CvSize ImageSize1 = cvSize(1000,700); Image1 = cvCreateImage(ImageSize1, IPL_DEPTH_8U, 3); Ipl 阅读全文
摘要:
IplImage* cvGetSubImage(IplImage *image, CvRect roi){IplImage *result;// 设置 ROIcvSetImageROI(image,roi);// 创建子图像result = cvCreateImage( cvSize(roi.width, roi.height), image->depth, image->nChannels );cvCopy(image,result);cvResetImageROI(image);return result;} 阅读全文
摘要:
voidBitMatToWnd(CWnd* pWnd, cv::Mat img, CRect *Roi){ if(img.empty()) return; CRect drect; pWnd->GetClientRect(drect); //(drect); (&drect); 两种方式均可,竟然 CClientDC dc(pWnd); HDC hDC =dc.GetSafeHdc(); //内存中的图像数据拷贝到屏幕上 BYTE *bitBuffer = NULL; BITMAPINFO *bitMapinfo =... 阅读全文
摘要:
opencv\modules\core\include\opencv2\core\version.hpp修改:#define CV_MAJOR_VERSION 2#define CV_MINOR_VERSION 4#define CV_SUBMINOR_VERSION 0opencv配置:opencv\cmake目录下 阅读全文
摘要:
创建:CMFCPropertyGridCtrl m_wndPropList ;CRect rectDummy;rectDummy.SetRectEmpty ();if (!m_wndPropList .Create (WS_VISIBLE | WS_CHILD, rectDummy, this, 1)){ TRACE0("Failed to create Properies Grid \n"); return -1; // fail to create}m_wndPropList.EnableHeaderCtrl (FALSE);//标头m_wndPropList.Enab 阅读全文
摘要:
1) 在View中获得Doc指针 CYourSDIDoc *pDoc=GetDocument();一个视只能有一个文档。 2) 在App中获得MainFrame指针 CWinApp 中的 m_pMainWnd变量就是MainFrame的指针 也可以: CMainFrame *pMain =(CMainFrame *)AfxGetMainWnd(); 3) 在View中获得MainFrame指针 CMainFrame *pMain=(CmaimFrame *)AfxGetApp()->m_pMainWnd; 4) 获得View(已建立)指... 阅读全文
摘要:
public static T ByteToStructure<T>(byte[] dataBuffer) { object structure = null; int size = Marshal.SizeOf(typeof(T)); IntPtr allocIntPtr = Marshal.AllocHGlobal(size); try { Marshal.Copy(dataBuffer, 0, allocIntPtr, ... 阅读全文
摘要:
richTextBox1.Text = richTextBox1.Text + strLine + "\r\n"; richTextBox1.Select(richTextBox1.TextLength, 0); richTextBox1.ScrollToCaret(); 阅读全文