Screen Capturing and saving in .AVI
-
Hi, Iam new to VC++, Is there any body tell me how to capture screen and save it in .Avi. Santosh K
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 :)
-
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 :)
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