Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. Chinese
  4. QPainterPath填充问题
QtWS25 Last Chance

QPainterPath填充问题

Scheduled Pinned Locked Moved Chinese
3 Posts 1 Posters 5.8k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jixcjixc
    wrote on last edited by
    #1

    moveTo()隐含的开始一个新subpath ,并且闭合前一个subpath。
    绘制路径时如果多次使用moveTo(),最后使用painter.fillPath
    填充路径,只能填充每个subpath,不能将整个路径填充?
    有没有方法可以填充整个路径

    1 Reply Last reply
    0
    • J Offline
      J Offline
      jixcjixc
      wrote on last edited by
      #2

      基于Qt的FreeType字体轮廓解析
      http://blog.csdn.net/wang__sid/article/details/11601761

      绘制字体轮廓,最后希望能填充整个轮廓
      多次使用moveTo()只能填充每个subpath,不能填充整个轮廓

      方法一:将moveTo去掉或者改成arcMoveTo ,绘制是错误的
      方法二:使用
      QPainterPathStroker pathStroke;
      QPainterPath path1=pathStroke.createStroke(path);
      填充path1,也不能正确填充
      方法三:
      QPainterPath OuterPath;
      OuterPath.setFillRule(Qt::WindingFill);
      OuterPath.addRect(0, 0, 400,400);
      QPainterPath fillPath =OuterPath.intersected(path);
      填充fillPath ,也不能正确填充

      研究了好几天了,盼解决方案

      1 Reply Last reply
      0
      • J Offline
        J Offline
        jixcjixc
        wrote on last edited by
        #3

        有没有方法可以代替moveTo , 但并不开始一个新subpath 闭合前一个subpath ?
        采用OpenGL绘制能否解决这个问题?

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved