Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Flickering in custom draw ListCtrl

Flickering in custom draw ListCtrl

Scheduled Pinned Locked Moved C / C++ / MFC
questiongraphicsperformancehelp
5 Posts 3 Posters 0 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.
  • _ Offline
    _ Offline
    _mishgun
    wrote on last edited by
    #1

    I've inherited my control from CListCtrl and overriden OnCustomDraw. And in OnCustomDraw method i do my own drawing only at CDDS_ITEMPOSTPAINT|CDDS_SUBITEM stage. At other stages before this one CDRF_SKIPDEFAULT flag is UNset (i want standart CListCtrl to draw header). Now, with every drawing of my control it flickers. I tried to use double buffering (draw in memory DC and than BitBlt to original), but there was just black screen. Does anyone know what's the problem? And how can i avoid flickering? Thanks in advance.

    T 1 Reply Last reply
    0
    • _ _mishgun

      I've inherited my control from CListCtrl and overriden OnCustomDraw. And in OnCustomDraw method i do my own drawing only at CDDS_ITEMPOSTPAINT|CDDS_SUBITEM stage. At other stages before this one CDRF_SKIPDEFAULT flag is UNset (i want standart CListCtrl to draw header). Now, with every drawing of my control it flickers. I tried to use double buffering (draw in memory DC and than BitBlt to original), but there was just black screen. Does anyone know what's the problem? And how can i avoid flickering? Thanks in advance.

      T Offline
      T Offline
      Tomasz Sowinski
      wrote on last edited by
      #2

      With CDDS_POSTPAINT you're getting the chance to draw *after* item/subitem was painted. What kind of information are you displaying? Tomasz Sowinski -- http://www.shooltz.com

      "Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.

      M 1 Reply Last reply
      0
      • T Tomasz Sowinski

        With CDDS_POSTPAINT you're getting the chance to draw *after* item/subitem was painted. What kind of information are you displaying? Tomasz Sowinski -- http://www.shooltz.com

        "Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.

        M Offline
        M Offline
        mishgun
        wrote on last edited by
        #3

        I'm drawing images and text. the problem, why i cant use standart list, is that i have to draw multiple selection in my own way. e.g. selected images should be drawn like another image etc. its not my idea, so did customer want :( nobody is perfect

        T 1 Reply Last reply
        0
        • M mishgun

          I'm drawing images and text. the problem, why i cant use standart list, is that i have to draw multiple selection in my own way. e.g. selected images should be drawn like another image etc. its not my idea, so did customer want :( nobody is perfect

          T Offline
          T Offline
          Tomasz Sowinski
          wrote on last edited by
          #4

          You've mentioned that CDRF_SKIPDEFAULT is unset, so basically you're telling Windows to draw the default stuff and notify you when it's done. Except this 'selected image', what are other things you want to do with selection? Tomasz Sowinski -- http://www.shooltz.com

          "Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.

          M 1 Reply Last reply
          0
          • T Tomasz Sowinski

            You've mentioned that CDRF_SKIPDEFAULT is unset, so basically you're telling Windows to draw the default stuff and notify you when it's done. Except this 'selected image', what are other things you want to do with selection? Tomasz Sowinski -- http://www.shooltz.com

            "Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.

            M Offline
            M Offline
            mishgun
            wrote on last edited by
            #5

            damn now i'm sure - i'm stupid :( the problem wasnt in custom draw and not in listview at all but thank you for giving me a reason to think :) nobody is perfect

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups