zoukankan      html  css  js  c++  java
  • vc画线

    private:
     CPoint m_ptOrigin;

    CPtestView::CPtestView()
    {
     // TODO: add construction code here
        m_ptOrigin=0;
    }

    void CPtestView::OnLButtonDown(UINT nFlags, CPoint point)
    {
     // TODO: Add your message handler code here and/or call default
    // MessageBox("view clicked");
     m_ptOrigin=point;
     CView::OnLButtonDown(nFlags, point);
    }

    void CPtestView::OnLButtonUp(UINT nFlags, CPoint point)
    {

     // TODO: Add your message handler code here and/or call default
     //画线1
     
     /*HDC hdc;
     hdc=::GetDC(m_hWnd);
     MoveToEx(hdc,m_ptOrigin.x,m_ptOrigin.y,NULL);
     LineTo(hdc,point.x,point.y);
        ::ReleaseDC(m_hWnd,hdc);
        */

     //画线2
     /*
     CDC *pDc=GetDC();
        pDc->MoveTo(m_ptOrigin);
     pDc->LineTo(point);
        ReleaseDC(pDc);
        */

     //画线3
        /*
     CClientDC dc(this);//dc(GetParent());
     dc.MoveTo(m_ptOrigin);
     dc.LineTo(point);
        */
     /*
     //画线4
     //CWindowDC  dc(this);//本View的指针地址
     //CWindowDC  dc(GetParent());//父框架的指针地址
     CWindowDC  dc(GetDesktopWindow());//GetDesktopWindow();桌面得指针地址
     dc.MoveTo(m_ptOrigin);
     dc.LineTo(point);
        */

        //画线5
     /*
     CPen pen(PS_SOLID,10,RGB(255,0,0));
        CClientDC dc(this);
     CPen *pOldPen=dc.SelectObject(&pen);
     dc.MoveTo(m_ptOrigin);
     dc.LineTo(point);
     dc.SelectObject(pOldPen);
        */
     CView::OnLButtonUp(nFlags, point);

    }

  • 相关阅读:
    DRF 配置
    RESTful 设计方法(学习总结用)
    Chrome 开发者工具
    html中注释的php代码被解析
    正则
    局域网域名访问php项目
    jQuery 操作from表单数据序列化
    jQuery操作Table tr td方法
    鼠标焦点在input的某个位置上,点击一个button 在input光标处的增加文字
    858. Mirror Reflection
  • 原文地址:https://www.cnblogs.com/meiproject/p/1497101.html
Copyright © 2011-2022 走看看