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. How to copy from ClientDC to MemDC?

How to copy from ClientDC to MemDC?

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
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.
  • J Offline
    J Offline
    JHAKAS
    wrote on last edited by
    #1

    Hi I am plotting on the ClientDC. Now at the end of function i want to copy the content of the ClientDc to MemDC, so that it can be used for saving image as BMP or JPG. How to do this? Leave your mark wherever you go

    A PJ ArendsP 2 Replies Last reply
    0
    • J JHAKAS

      Hi I am plotting on the ClientDC. Now at the end of function i want to copy the content of the ClientDc to MemDC, so that it can be used for saving image as BMP or JPG. How to do this? Leave your mark wherever you go

      A Offline
      A Offline
      Alexander M
      wrote on last edited by
      #2

      what the hell is a MemDC? Don't try it, just do it! ;-)

      1 Reply Last reply
      0
      • J JHAKAS

        Hi I am plotting on the ClientDC. Now at the end of function i want to copy the content of the ClientDc to MemDC, so that it can be used for saving image as BMP or JPG. How to do this? Leave your mark wherever you go

        PJ ArendsP Offline
        PJ ArendsP Offline
        PJ Arends
        wrote on last edited by
        #3

        A simple BitBlt will do the trick. Just be sure your MemDC has a bitmap selected into it that is the same size and bit depth as your ClientDC.


        [

        ](http://www.canucks.com)Sonork 100.11743 Chicken Little "You're obviously a superstar." - Christian Graus about me - 12 Feb '03 Within you lies the power for good - Use it!

        Within you lies the power for good; Use it!

        J 1 Reply Last reply
        0
        • PJ ArendsP PJ Arends

          A simple BitBlt will do the trick. Just be sure your MemDC has a bitmap selected into it that is the same size and bit depth as your ClientDC.


          [

          ](http://www.canucks.com)Sonork 100.11743 Chicken Little "You're obviously a superstar." - Christian Graus about me - 12 Feb '03 Within you lies the power for good - Use it!

          J Offline
          J Offline
          JHAKAS
          wrote on last edited by
          #4

          Thanks Arends Well what my doubt with bitblt was that it copies from the bitmap to the DC(correct me if i am wrong) So the main problem is that can the bitblt will work for ClientDC. Leave your mark wherever you go

          PJ ArendsP 1 Reply Last reply
          0
          • J JHAKAS

            Thanks Arends Well what my doubt with bitblt was that it copies from the bitmap to the DC(correct me if i am wrong) So the main problem is that can the bitblt will work for ClientDC. Leave your mark wherever you go

            PJ ArendsP Offline
            PJ ArendsP Offline
            PJ Arends
            wrote on last edited by
            #5

            BitBlt copies data from one device context's drawing surface to another device context's drawing surface. CClientDC's drawing surface is the portion of the screen contained in your window, and your MemDC's drawing surface is the bitmap you select into it. A drawing surface can be anything: a memory bitmap, the monitor, a printer, a plotter, etc.


            [

            ](http://www.canucks.com)Sonork 100.11743 Chicken Little "You're obviously a superstar." - Christian Graus about me - 12 Feb '03 Within you lies the power for good - Use it!

            Within you lies the power for good; Use 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