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. Save Client Area as Image

Save Client Area as Image

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

    I think this is very Simple Question but I am new babie :-O . In the SDI application. I draw something on the client area. I want to save this as a BMP and some other formats(GIF, JPEG . . .). So that this image can be open in any other software. My primary goal is to save it as BMP format. I want to do this without using any other's library. And also without using MFC (If possible, I hope) :confused:. Thanks in advance. Some sample code will help alot.

    R C 2 Replies Last reply
    0
    • S syedhassan4

      I think this is very Simple Question but I am new babie :-O . In the SDI application. I draw something on the client area. I want to save this as a BMP and some other formats(GIF, JPEG . . .). So that this image can be open in any other software. My primary goal is to save it as BMP format. I want to do this without using any other's library. And also without using MFC (If possible, I hope) :confused:. Thanks in advance. Some sample code will help alot.

      R Offline
      R Offline
      Rickard Andersson20
      wrote on last edited by
      #2

      Questions like this one are very difficult to give an answer to! syedhassan4 wrote: I want to do this without using any other's library. And also without using MFC (If possible, I hope) . The answer is many many lines of code and if you want an answer I think you have to take a look at some classes or something that do what you want to do and then ask here if you'll get problems when trying to do something similarly! ;) :) ;) :rose: ------------------------------ ©0d3 ©®4©k3® - That's me! :) ------------------------------

      C 1 Reply Last reply
      0
      • R Rickard Andersson20

        Questions like this one are very difficult to give an answer to! syedhassan4 wrote: I want to do this without using any other's library. And also without using MFC (If possible, I hope) . The answer is many many lines of code and if you want an answer I think you have to take a look at some classes or something that do what you want to do and then ask here if you'll get problems when trying to do something similarly! ;) :) ;) :rose: ------------------------------ ©0d3 ©®4©k3® - That's me! :) ------------------------------

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        Actually it's damn easy. Just use GetWindowDC to get a handle to the windows device context and use GDI+ to save the image. Christian I have come to clean zee pooollll. - Michael Martin Dec 30, 2001 Picture the daffodil. And while you do that, I'll be over here going through your stuff. Picture a world without war, without hate. And I can picture us attacking that world, because they would never expect it.

        Sonork ID 100.10002:MeanManOz

        I live in Bob's HungOut now

        1 Reply Last reply
        0
        • S syedhassan4

          I think this is very Simple Question but I am new babie :-O . In the SDI application. I draw something on the client area. I want to save this as a BMP and some other formats(GIF, JPEG . . .). So that this image can be open in any other software. My primary goal is to save it as BMP format. I want to do this without using any other's library. And also without using MFC (If possible, I hope) :confused:. Thanks in advance. Some sample code will help alot.

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          My 'Doodle' article shows how to use GDI+ to save an image to disk in different formats, the CXImage class also on CP shows a way to do it which doesn't involve downloading the SDK or relying on a DLL. Use GetWindowDC to get a device context you can use to grab the contents of the window. Just remember to make the Image you create the same bit depth as the screen, you can use GetDeviceCaps(BITSPIXEL) on the DC you get back from GetWindowDC to figure out what you need. Christian I have come to clean zee pooollll. - Michael Martin Dec 30, 2001 Picture the daffodil. And while you do that, I'll be over here going through your stuff. Picture a world without war, without hate. And I can picture us attacking that world, because they would never expect it.

          Sonork ID 100.10002:MeanManOz

          I live in Bob's HungOut now

          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