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. Other Discussions
  3. Clever Code
  4. Double Buffering gone mad

Double Buffering gone mad

Scheduled Pinned Locked Moved Clever Code
comgraphicsperformancehelp
7 Posts 7 Posters 6 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.
  • M Offline
    M Offline
    Megidolaon
    wrote on last edited by
    #1

    I tried myself on double buffering and came across a pretty funny bug. I painted one of the standard windows background images on screen, scaled down to 10% of the original size and as often as it would fit into the client area of the form. Without double buffering it was perfectly fine, I could watch as the small images filled the client area one by one. http://i35.tinypic.com/20r4q53.jpg[^] However, with double buffering, first painting the image to the Bitmap that was in memory and after everything was done, painting it on screen, I got a pretty weird result. http://i35.tinypic.com/344xe3b.jpg[^]

    C T 2 Replies Last reply
    0
    • M Megidolaon

      I tried myself on double buffering and came across a pretty funny bug. I painted one of the standard windows background images on screen, scaled down to 10% of the original size and as often as it would fit into the client area of the form. Without double buffering it was perfectly fine, I could watch as the small images filled the client area one by one. http://i35.tinypic.com/20r4q53.jpg[^] However, with double buffering, first painting the image to the Bitmap that was in memory and after everything was done, painting it on screen, I got a pretty weird result. http://i35.tinypic.com/344xe3b.jpg[^]

      C Offline
      C Offline
      Chris Maunder
      wrote on last edited by
      #2

      Where's the subtlety?

      cheers, Chris Maunder

      CodeProject.com : C++ MVP

      P G P L 4 Replies Last reply
      0
      • C Chris Maunder

        Where's the subtlety?

        cheers, Chris Maunder

        CodeProject.com : C++ MVP

        P Offline
        P Offline
        Paul Conrad
        wrote on last edited by
        #3

        Was wondering that myself and how did he fix it?

        "The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon

        1 Reply Last reply
        0
        • C Chris Maunder

          Where's the subtlety?

          cheers, Chris Maunder

          CodeProject.com : C++ MVP

          G Offline
          G Offline
          geoffs
          wrote on last edited by
          #4

          There's no subtlety in that at all. Without knowing the details of how the OP was doing the tiling into the bitmap, and just looking at the result, I'd guess that the code was not correctly accounting for the destination bitmap's ystep (ie: step in bytes from one pixel of one row to the same pixel in an adjacent row).

          1 Reply Last reply
          0
          • C Chris Maunder

            Where's the subtlety?

            cheers, Chris Maunder

            CodeProject.com : C++ MVP

            P Offline
            P Offline
            peterchen
            wrote on last edited by
            #5

            The results look like he painted mixed up source and target buffer, somehow - the already painted scaled-down-by-10 images are overlaid on the next ones.

            We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP
            blog: TDD - the Aha! | Linkify!| FoldWithUs! | sighist

            1 Reply Last reply
            0
            • M Megidolaon

              I tried myself on double buffering and came across a pretty funny bug. I painted one of the standard windows background images on screen, scaled down to 10% of the original size and as often as it would fit into the client area of the form. Without double buffering it was perfectly fine, I could watch as the small images filled the client area one by one. http://i35.tinypic.com/20r4q53.jpg[^] However, with double buffering, first painting the image to the Bitmap that was in memory and after everything was done, painting it on screen, I got a pretty weird result. http://i35.tinypic.com/344xe3b.jpg[^]

              T Offline
              T Offline
              The Cake of Deceit
              wrote on last edited by
              #6

              That's not weird, it's a work of art!

              Chuck Norris has the greatest Poker-Face of all time. He won the 1983 World Series of Poker, despite holding only a Joker, a Get out of Jail Free Monopoloy card, a 2 of clubs, 7 of spades and a green #4 card from the game UNO.


              In the movie "The Matrix", Chuck Norris is the Matrix. If you pay close attention in the green "falling code" scenes, you can make out the faint texture of his beard.


              Chuck Norris actually owns IBM. It was an extremely hostile takeover.

              1 Reply Last reply
              0
              • C Chris Maunder

                Where's the subtlety?

                cheers, Chris Maunder

                CodeProject.com : C++ MVP

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                I don't care if it's not subtle - i seriously lol'd :D

                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