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. SetDIBits and GetDIBits in MFC?

SetDIBits and GetDIBits in MFC?

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpquestion
5 Posts 4 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.
  • Y Offline
    Y Offline
    yasde
    wrote on last edited by
    #1

    Hi everybody ! Can you help me on finding the equivalant of these functions in MFC? Many thanks in advance. bi.bmiHeader.biSize = sizeof(bi.bmiHeader); bi.bmiHeader.biWidth = dstX; bi.bmiHeader.biHeight = dstY; bi.bmiHeader.biPlanes = 1; bi.bmiHeader.biBitCount = 32; bi.bmiHeader.biCompression = BI_RGB; bi.bmiHeader.biSizeImage = dstX * 4 * dstY; bi.bmiHeader.biClrUsed = 0; bi.bmiHeader.biClrImportant = 0; **SetDIBits(hdcDst, hBmpDst, 0, dstY, dst, &bi, DIB_RGB_COLORS);** bi.bmiHeader.biSize = sizeof(bi.bmiHeader); bi.bmiHeader.biWidth = nx; bi.bmiHeader.biHeight = - ny; bi.bmiHeader.biPlanes = 1; bi.bmiHeader.biBitCount = 32; bi.bmiHeader.biCompression = BI_RGB; bi.bmiHeader.biSizeImage = nx * 4 * ny; bi.bmiHeader.biClrUsed = 0; bi.bmiHeader.biClrImportant = 0; buf = (pBGR) malloc(nx * 4 * ny); **bRes = GetDIBits(cdcSrc, cBmpSrc, 0, ny, buf, &bi, DIB_RGB_COLORS);**

    C Y 2 Replies Last reply
    0
    • Y yasde

      Hi everybody ! Can you help me on finding the equivalant of these functions in MFC? Many thanks in advance. bi.bmiHeader.biSize = sizeof(bi.bmiHeader); bi.bmiHeader.biWidth = dstX; bi.bmiHeader.biHeight = dstY; bi.bmiHeader.biPlanes = 1; bi.bmiHeader.biBitCount = 32; bi.bmiHeader.biCompression = BI_RGB; bi.bmiHeader.biSizeImage = dstX * 4 * dstY; bi.bmiHeader.biClrUsed = 0; bi.bmiHeader.biClrImportant = 0; **SetDIBits(hdcDst, hBmpDst, 0, dstY, dst, &bi, DIB_RGB_COLORS);** bi.bmiHeader.biSize = sizeof(bi.bmiHeader); bi.bmiHeader.biWidth = nx; bi.bmiHeader.biHeight = - ny; bi.bmiHeader.biPlanes = 1; bi.bmiHeader.biBitCount = 32; bi.bmiHeader.biCompression = BI_RGB; bi.bmiHeader.biSizeImage = nx * 4 * ny; bi.bmiHeader.biClrUsed = 0; bi.bmiHeader.biClrImportant = 0; buf = (pBGR) malloc(nx * 4 * ny); **bRes = GetDIBits(cdcSrc, cBmpSrc, 0, ny, buf, &bi, DIB_RGB_COLORS);**

      C Offline
      C Offline
      CPallini
      wrote on last edited by
      #2

      You know, Win32 API functions are available to MFC code... :rolleyes:

      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
      This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
      [My articles]

      H 1 Reply Last reply
      0
      • C CPallini

        You know, Win32 API functions are available to MFC code... :rolleyes:

        If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
        This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
        [My articles]

        H Offline
        H Offline
        Hamid Taebi
        wrote on last edited by
        #3

        Yes.

        Of one Essence is the human race thus has Creation put the base One Limb impacted is sufficient For all Others to feel the Mace (Saadi )

        C 1 Reply Last reply
        0
        • H Hamid Taebi

          Yes.

          Of one Essence is the human race thus has Creation put the base One Limb impacted is sufficient For all Others to feel the Mace (Saadi )

          C Offline
          C Offline
          CPallini
          wrote on last edited by
          #4

          knowing that you know makes me happy :-D

          If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
          This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
          [My articles]

          1 Reply Last reply
          0
          • Y yasde

            Hi everybody ! Can you help me on finding the equivalant of these functions in MFC? Many thanks in advance. bi.bmiHeader.biSize = sizeof(bi.bmiHeader); bi.bmiHeader.biWidth = dstX; bi.bmiHeader.biHeight = dstY; bi.bmiHeader.biPlanes = 1; bi.bmiHeader.biBitCount = 32; bi.bmiHeader.biCompression = BI_RGB; bi.bmiHeader.biSizeImage = dstX * 4 * dstY; bi.bmiHeader.biClrUsed = 0; bi.bmiHeader.biClrImportant = 0; **SetDIBits(hdcDst, hBmpDst, 0, dstY, dst, &bi, DIB_RGB_COLORS);** bi.bmiHeader.biSize = sizeof(bi.bmiHeader); bi.bmiHeader.biWidth = nx; bi.bmiHeader.biHeight = - ny; bi.bmiHeader.biPlanes = 1; bi.bmiHeader.biBitCount = 32; bi.bmiHeader.biCompression = BI_RGB; bi.bmiHeader.biSizeImage = nx * 4 * ny; bi.bmiHeader.biClrUsed = 0; bi.bmiHeader.biClrImportant = 0; buf = (pBGR) malloc(nx * 4 * ny); **bRes = GetDIBits(cdcSrc, cBmpSrc, 0, ny, buf, &bi, DIB_RGB_COLORS);**

            Y Offline
            Y Offline
            yoaz
            wrote on last edited by
            #5

            MFC uses CDC wrapper to handle device contexts as a wrapper for most sorts of images

            there are no facts, only interpretations

            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