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. CDC bitblt function with HDC parameter?

CDC bitblt function with HDC parameter?

Scheduled Pinned Locked Moved C / C++ / MFC
question
4 Posts 2 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.
  • E Offline
    E Offline
    econy
    wrote on last edited by
    #1

    Hi,I wonder how a bitblt function of a CDC object, which src is a HDC object? like:

    MemDC.BitBlt(Icon.pos_x, Icon.pos_y, bm.w, bm.h,HdcObject,0,0,SRCCOPY);

    A 1 Reply Last reply
    0
    • E econy

      Hi,I wonder how a bitblt function of a CDC object, which src is a HDC object? like:

      MemDC.BitBlt(Icon.pos_x, Icon.pos_y, bm.w, bm.h,HdcObject,0,0,SRCCOPY);

      A Offline
      A Offline
      Albert Holguin
      wrote on last edited by
      #2

      Quote:

      which src is a HDC object?

      What? That doesn't make sense. Try rephrasing or expand on what you're trying to ask.

      E 1 Reply Last reply
      0
      • A Albert Holguin

        Quote:

        which src is a HDC object?

        What? That doesn't make sense. Try rephrasing or expand on what you're trying to ask.

        E Offline
        E Offline
        econy
        wrote on last edited by
        #3

        I mean HdcObject in the code. I just want to copy a HDC object to CDC object, use CDC object's BitBlt() function.

        A 1 Reply Last reply
        0
        • E econy

          I mean HdcObject in the code. I just want to copy a HDC object to CDC object, use CDC object's BitBlt() function.

          A Offline
          A Offline
          Albert Holguin
          wrote on last edited by
          #4

          HDC is a handle not an object.... You can use CDC::FromHandle() to get a temporary object for immediate use. Alternatively, you can CDC::Attach() to keep a more permanent CDC object around. You should make sure you release a device context (DC) when you're done using it (FromHandle sort of automatically handles this situation by going out of scope). If you have CWnds, you can also get a pointer to an existing CDC with CWnd::GetDC(). There is a lot of info on drawing in GDI online, I suggest you read up on it.

          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