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. Graphics
  4. DIB

DIB

Scheduled Pinned Locked Moved Graphics
performancequestion
8 Posts 3 Posters 8 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.
  • B Offline
    B Offline
    balu chettri
    wrote on last edited by
    #1

    Can I select a DIB into a memory Device Context? If yes, then how? B2C

    M J 2 Replies Last reply
    0
    • B balu chettri

      Can I select a DIB into a memory Device Context? If yes, then how? B2C

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      No. The docs for SelectObject[^] explain what can be selected into a DC. But, you can select a DIBSection into a mem DC. See CreateDIBSection[^] or you can create a DDB from a DIB with CreateDIBitmap[^] Mark

      "Great job, team. Head back to base for debriefing and cocktails." (Spottswoode "Team America")

      J 1 Reply Last reply
      0
      • M Mark Salsbery

        No. The docs for SelectObject[^] explain what can be selected into a DC. But, you can select a DIBSection into a mem DC. See CreateDIBSection[^] or you can create a DDB from a DIB with CreateDIBitmap[^] Mark

        "Great job, team. Head back to base for debriefing and cocktails." (Spottswoode "Team America")

        J Offline
        J Offline
        John R Shaw
        wrote on last edited by
        #3

        Sorry, wrong! Unless you know something I do not.

        INTP "Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra

        M 1 Reply Last reply
        0
        • B balu chettri

          Can I select a DIB into a memory Device Context? If yes, then how? B2C

          J Offline
          J Offline
          John R Shaw
          wrote on last edited by
          #4

          Yes! A dib is just a bitmap and if your program can load it you can display it. The problems occur when it is not a dib (essentially a “.bmp”), in which case you will need to convert it using code like “CxImage” (at CP). See LoadImage (MSDN).

          INTP "Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra

          1 Reply Last reply
          0
          • J John R Shaw

            Sorry, wrong! Unless you know something I do not.

            INTP "Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra

            M Offline
            M Offline
            Mark Salsbery
            wrote on last edited by
            #5

            Are you sure you're not mixing up DDBs and DIBs? If so how does one select a DIB into a device context?

            "Great job, team. Head back to base for debriefing and cocktails." (Spottswoode "Team America")

            J 1 Reply Last reply
            0
            • M Mark Salsbery

              Are you sure you're not mixing up DDBs and DIBs? If so how does one select a DIB into a device context?

              "Great job, team. Head back to base for debriefing and cocktails." (Spottswoode "Team America")

              J Offline
              J Offline
              John R Shaw
              wrote on last edited by
              #6

              :-O I apologize; at one time I was so used to dealing with raw DIBs that I forgot that they needed to be converted to a GDI DIB via CreateDIBSection, which converts a raw DIB to a DIB that the GDI recognizes, before it could be selected into a DC.

              INTP "Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra

              M 1 Reply Last reply
              0
              • J John R Shaw

                :-O I apologize; at one time I was so used to dealing with raw DIBs that I forgot that they needed to be converted to a GDI DIB via CreateDIBSection, which converts a raw DIB to a DIB that the GDI recognizes, before it could be selected into a DC.

                INTP "Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra

                M Offline
                M Offline
                Mark Salsbery
                wrote on last edited by
                #7

                :) No apology necessary for sure. I wonder what happened to the OP? Cheers! Mark

                "Great job, team. Head back to base for debriefing and cocktails." (Spottswoode "Team America")

                J 1 Reply Last reply
                0
                • M Mark Salsbery

                  :) No apology necessary for sure. I wonder what happened to the OP? Cheers! Mark

                  "Great job, team. Head back to base for debriefing and cocktails." (Spottswoode "Team America")

                  J Offline
                  J Offline
                  John R Shaw
                  wrote on last edited by
                  #8

                  They often disappear after the original post. Some times they come back and say thanks and other times they just continue on with their lives, with a little more information. I have been guilty of both! ;) P.S. I have been known to disappear for weeks!

                  INTP "Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra

                  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