- 博客(0)
- 资源 (6)
- 收藏
- 关注
Visual+C MFC编程实例与源码.rar
Visual+C MFC编程实例与源码本书通过85个实例全面讲述了应用MFC进行Visual C++编程的思想。每个实例均以编写一个应用程序要走的步骤编写。
2013-05-21
邮件收发器
邮件收发器邮件
收发器.h This is the main header file for the application. It includes other project specific headers (including Resource.h) and declares the CMyApp application class. 邮件收发器.cpp This is the main application source file that contains the application class CMyApp.
2013-05-17
OPENGL鼠标键盘移动3d物体
OPENGL鼠标键盘移动3d物体
void CCY457OpenGLView::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) { // TODO: Add your message handler code here and/or call default switch (nChar) { case VK_UP: m_yPos = m_yPos + 0.1f; break; case VK_DOWN: m_yPos = m_yPos - 0.1f; break; case VK_LEFT: m_xPos = m_xPos - 0.1f; break; case VK_RIGHT: m_xPos = m_xPos + 0.1f; break; default: MessageBox("Press the arrow keys only"); break; } InvalidateRect(NULL,FALSE); CView::OnKeyDown(nChar, nRepCnt, nFlags); } void CCY457OpenGLView::OnLButtonDown(UINT nFlags, CPoint point) { // TODO: Add your message handler code here and/or call default m_MouseDownPoint=point; SetCapture(); CView::OnLButtonDown(nFlags, point); } void CCY457OpenGLView::OnLButtonUp(UINT nFlags, CPoint point) { // TODO: Add your message handler code here and/or call default m_MouseDownPoint=CPoint(0,0); ReleaseCapture(); CView::OnLButtonUp(nFlags, point); } void CCY457OpenGLView::OnMouseMove(UINT nFlags, CPoint point) { // TODO: Add your message handler code here and/or call default if (GetCapture()==this) { //Increment the object rotation angles m_xAngle+=(point.y-m_MouseDownPoint.y)/3.6; m_yAngle+=(point.x-m_MouseDownPoint.x)/3.6; //Redraw the view InvalidateRect(NULL,FALSE); //Set the mouse point m_MouseDownPoint=point; }; CView::OnMouseMove(nFlags, point); }
2013-04-07
照片底片曝光
VC++编程对照片处理底片设定曝光时间
//根据位图的大小改变窗口的大小 pWnd-> SetWindowPos(NULL,0,0,bm.bmWidth,bm.bmHeight,SWP_NOMOVE); //在内存中生成一个兼容设备,然后拷贝到屏幕显示 pDC = pWnd-> GetDC(); //取得绘图设备 memDC.CreateCompatibleDC(pDC);//生成一个兼容设备 memDC.SelectObject (bmpDisplay);//在兼容设备中装载位图 //显示 pWnd-> GetClientRect(&rect); //得到控件窗口的 "视 "区域 pDC-> StretchBlt(0,0,rect.Width(),rect.Height(),&memDC,0,0,bm.bmWidth,bm.bmHeight,SRCCOPY); ReleaseDC(pDC); DeleteDC(memDC); mBitmap.Detach(); DeleteObject(bmpDisplay); pImg = cvLoadImage("D:\\n.bmp", 1); img1 = cvCreateImage(cvGetSize(pImg),IPL_DEPTH_8U,3); img2 = cvCreateImage(cvGetSize(pImg),IPL_DEPTH_8U,3); img3 = cvCreateImage(cvGetSize(pImg),IPL_DEPTH_8U,3); for(i=0;i<pImg->height;i++) { for(j=0;j<pImg->width;j++) { s=cvGet2D(pImg,i,j); // get the (i,j) pixel value s1.val[0]=0; s1.val[1]=s.val[1]; s1.val[2]=s.val[2]; cvSet2D(img1,i,j,s1); // set the (i,j) pixel value } } for(i=0;i<pImg->height;i++) { for(j=0;j<pImg->width;j++) { s=cvGet2D(pImg,i,j); // get the (i,j) pixel value s1.val[0]=s.val[0]; s1.val[1]=0; s1.val[2]=s.val[2]; cvSet2D(img2,i,j,s1); // set the (i,j) pixel value } } for(i=0;i<pImg->height;i++) { for(j=0;j<pImg->width;j++) { s=cvGet2D(pImg,i,j); // get the (i,j) pixel value s1.val[0]=s.val[0]; s1.val[1]=s.val[1]; s1.val[2]=0; cvSet2D(img3,i,j,s1); // set the (i,j) pixel value } } img = cvCreateImage(cvGetSize(pImg),IPL_DEPTH_8U,3); for(i=0;i<pImg->height;i++) { for(j=0;j<pImg->width;j++) { s=cvGet2D(img1,i,j); // get the (i,j) pixel value s1.val[0]=s.val[0]; s1.val[1]=s.val[1]; s1.val[2]=0; cvSet2D(img,i,j,s1); // set the (i,j) pixel value } } cvSaveImage("D:\\b.bmp", img1); cvSaveImage("D:\\g.bmp", img2); cvSaveImage("D:\\r.bmp", img3); } void
2013-04-07
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人