Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. Qt, 3rd Party Library and Fast Drawing
Forum Updated to NodeBB v4.3 + New Features

Qt, 3rd Party Library and Fast Drawing

Scheduled Pinned Locked Moved Unsolved 3rd Party Software
3 Posts 2 Posters 1.2k Views 1 Watching
  • 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.
  • kwebster83K Offline
    kwebster83K Offline
    kwebster83
    wrote on last edited by
    #1

    Hi All,

    I'm in the process of moving one of our in-house software packages over to Qt from Delphi. The application in question uses a 3rd party library which exposes a number of API functions - one of which draws onto a HDC.

    Using my limited knowledge of Qt, I've successfully managed to bring in this 3rd party library and I'm able to successfully call these API routines. So far so good. However, I'm yet to find the most efficient way of calling the API function to draw onto a HDC within Qt while maintaining good performance.

    My solution so far see's me handle a QWidget "paintEvent", inside which I call CreateCompatibleBitmap/DC and then draw onto that first. I then take the HBITMAP and turn it into a QImage (via a QPixmap -> QtWin::fromHBITMAP) before painting it through my QPainter.

    This seems a bit clunky and a bit messy and going via the QPixmap/QImage is a little sluggish when compared to the equivalent Delphi application. So ultimately, what I'd like to know is, is there a better way to tackle this?

    Thanks in advance for any advice.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      This stackoverflow answer might give some nice clues.

      Hope it helps

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      kwebster83K 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        This stackoverflow answer might give some nice clues.

        Hope it helps

        kwebster83K Offline
        kwebster83K Offline
        kwebster83
        wrote on last edited by
        #3

        @SGaist Thanks for the link. I shall give this a try.

        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