zoukankan      html  css  js  c++  java
  • 毛笔算法 毛笔签名效果

    采用C++编写的纯算法,底层封装了CMyPen类,含有4种笔,分别是毛笔,画笔,荧光笔,水笔.
    非常容易调用,只用响应鼠标消息

    笔锋签名 毛笔签名  毛笔签名效果算法

     
    void CDrawProView::OnLButtonDown(UINT nFlags, CPoint point)
    {
     if (m_nCmd != CMD_NULL)
     {
      if (m_nCmd == CMD_LINE_PEN)
      {
       if (m_bPickPoint)
       {
        m_myPen.DrawLine(m_ptLastEnd, point);
        m_bPickPoint = FALSE;
       }
       else
       {
        m_myPen.DrawPoint(point);
        m_ptLastEnd = point;
        m_bPickPoint = TRUE;
       }
      }
      else if (m_nCmd == CMD_BRUSH_PEN)
      {
       m_myPen.PushStart(point);
      }
      else if (m_nCmd == CMD_OTHER_PEN)
      {
      }
      Invalidate(FALSE);
     }
     m_bMouseDown = TRUE;
     CView::OnLButtonDown(nFlags, point);
    }
    void CDrawProView::OnLButtonUp(UINT nFlags, CPoint point)
    {
     if (m_nCmd != CMD_NULL)
     {
      if (m_nCmd == CMD_LINE_PEN)
      {
      }
      else if (m_nCmd == CMD_BRUSH_PEN)
      {
       m_myPen.PushEnd(point);
      }
      else if (m_nCmd == CMD_OTHER_PEN)
      {
      }
      Invalidate(FALSE);
     }
     m_bMouseDown = FALSE;
     CView::OnLButtonUp(nFlags, point);
    }
    void CDrawProView::OnMouseMove(UINT nFlags, CPoint point)
    {
     if (m_nCmd != CMD_NULL)
     {
      if (m_nCmd == CMD_LINE_PEN)
      {
      }
      else if (m_nCmd == CMD_BRUSH_PEN)
      {
       if (m_bMouseDown)
       {
        m_myPen.Push(point);
       }
      }
      else if (m_nCmd == CMD_OTHER_PEN)
      {
      }
      Invalidate(FALSE);
     }
     CView::OnMouseMove(nFlags, point);
    }
    void CDrawProView::OnSize(UINT nType, int cx, int cy)
    {
     CView::OnSize(nType, cx, cy);
     size_draw();
     // TODO: 在此处添加消息处理程序代码
    }
     
    demo效果图,

    http://www.etfsoft.com/other/downsgoogle/maobi.rar  毛笔算法


    13762930029  QQ77211022

  • 相关阅读:
    Assimp对FBX文件中geometric transformations的处理
    VSM
    WSL安装
    [p1880][NOI1995]石子合并
    【日常】集训总结
    【模板】背包
    【济南集训】20191006解题报告
    [P1516]青蛙的约会
    【模板】ST表
    【济南集训】20191001解题报告
  • 原文地址:https://www.cnblogs.com/etfsoft/p/3111928.html
Copyright © 2011-2022 走看看