上一页 1 ··· 29 30 31 32 33 34 35 36 37 ··· 76 下一页
摘要: 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; //! ... 阅读全文
posted @ 2013-06-26 12:16 ahuo 阅读(18684) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2013-06-18 09:50 ahuo 阅读(4132) 评论(1) 推荐(0) 编辑
摘要: //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... 阅读全文
posted @ 2013-06-09 23:00 ahuo 阅读(395) 评论(0) 推荐(0) 编辑
摘要: 在头文件中声明函数例如 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 第四个参... 阅读全文
posted @ 2013-05-31 09:04 ahuo 阅读(348) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2013-05-16 15:27 ahuo 阅读(523) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2013-05-08 17:09 ahuo 阅读(230) 评论(0) 推荐(0) 编辑
摘要: stdafx.h 加入#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"") 阅读全文
posted @ 2013-05-03 16:40 ahuo 阅读(461) 评论(0) 推荐(0) 编辑
摘要: #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 阅读全文
posted @ 2013-05-02 23:35 ahuo 阅读(1105) 评论(0) 推荐(0) 编辑
摘要: 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;} 阅读全文
posted @ 2013-04-20 21:51 ahuo 阅读(319) 评论(0) 推荐(0) 编辑
摘要: 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 =... 阅读全文
posted @ 2013-04-16 23:06 ahuo 阅读(1704) 评论(0) 推荐(0) 编辑
摘要: 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目录下 阅读全文
posted @ 2013-04-16 11:23 ahuo 阅读(640) 评论(0) 推荐(0) 编辑
摘要: 创建: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 阅读全文
posted @ 2013-04-14 21:46 ahuo 阅读(227) 评论(0) 推荐(0) 编辑
摘要: 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(已建立)指... 阅读全文
posted @ 2013-04-14 20:20 ahuo 阅读(307) 评论(0) 推荐(0) 编辑
摘要: 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, ... 阅读全文
posted @ 2013-03-27 11:22 ahuo 阅读(311) 评论(0) 推荐(0) 编辑
摘要: richTextBox1.Text = richTextBox1.Text + strLine + "\r\n"; richTextBox1.Select(richTextBox1.TextLength, 0); richTextBox1.ScrollToCaret(); 阅读全文
posted @ 2013-02-26 14:37 ahuo 阅读(415) 评论(0) 推荐(0) 编辑
上一页 1 ··· 29 30 31 32 33 34 35 36 37 ··· 76 下一页