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. Screen Capturing and saving in .AVI

Screen Capturing and saving in .AVI

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorial
3 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
    santosh k
    wrote on last edited by
    #1

    Hi, Iam new to VC++, Is there any body tell me how to capture screen and save it in .Avi. Santosh K

    A 1 Reply Last reply
    0
    • S santosh k

      Hi, Iam new to VC++, Is there any body tell me how to capture screen and save it in .Avi. Santosh K

      A Offline
      A Offline
      Abhishek Srivastava
      wrote on last edited by
      #2

      for capturing screen imgae use GetDesktopWindow() this will return u the handle of desktop window then using you can get the DC of your desktop like this HWND Desktophwnd = GetDesktopWindow(); CWnd wnd; wnd.Attach(Desktophwnd) ; then query for desktop DC CDC desktopDC = wnd.GetDC(); now using bitmap funtions of CDC class u can actually get the screen bitmap and then for saving it into AVi u have to create Video stream and can save easily ur images in AVI file // for creating AVI u can use library vfw32.lib using AVI function of this libray you can create ur own AVI file by writing AUDIO/VIDEO data in it. like 0 AVIFileInit // for initializing AVI library 1 AVIFileOpen // for creating AVI File 2 AVIStreamCreate / for creating Audio/ video stream 3 AVIStreamWrite //for writing audio video data 5 AVIFileClose // for closing ur file 4 AVIFileExit / un initializing the library For capturing every movement and action taking place on desktop u have to write ur whole image capturing code and saving code in a worker thread. Regards :) Abhishek Srivastava Software Engineer (VC++) India ,Noida Mobile no 9891492921 :)

      T 1 Reply Last reply
      0
      • A Abhishek Srivastava

        for capturing screen imgae use GetDesktopWindow() this will return u the handle of desktop window then using you can get the DC of your desktop like this HWND Desktophwnd = GetDesktopWindow(); CWnd wnd; wnd.Attach(Desktophwnd) ; then query for desktop DC CDC desktopDC = wnd.GetDC(); now using bitmap funtions of CDC class u can actually get the screen bitmap and then for saving it into AVi u have to create Video stream and can save easily ur images in AVI file // for creating AVI u can use library vfw32.lib using AVI function of this libray you can create ur own AVI file by writing AUDIO/VIDEO data in it. like 0 AVIFileInit // for initializing AVI library 1 AVIFileOpen // for creating AVI File 2 AVIStreamCreate / for creating Audio/ video stream 3 AVIStreamWrite //for writing audio video data 5 AVIFileClose // for closing ur file 4 AVIFileExit / un initializing the library For capturing every movement and action taking place on desktop u have to write ur whole image capturing code and saving code in a worker thread. Regards :) Abhishek Srivastava Software Engineer (VC++) India ,Noida Mobile no 9891492921 :)

        T Offline
        T Offline
        Thierry Maurel
        wrote on last edited by
        #3

        in the same way, is there a simple method to capture image from an avi (or mpeg, divx, etc) at a certain position, and in 'hide' mode (i.e. no screen drawing, no screen capture..). I try that with DirectX in a worker thread, but there is a crash because of bad COM initialization or release... Thanks for ideas... Thierry

        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