Hi!
I want to write a code to capture the current screen. How can I do this please?
Thanks.
Hi!
I want to write a code to capture the current screen. How can I do this please?
Thanks.
Press Print Screen
Open up your fav paint program.
Edit->Paste as New Image.
As far as code goes...I'm sure it has something to do with the Windows clipboard.
I'm trying the below code, but it's not working. And could anyone please explain the "capture driver index" parameter of capDriverConnect()?
Code:#include "stdafx.h" #pragma comment(lib, "vfw32") #include<vfw.h> int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { HWND hwnd = capCreateCaptureWindow ( "Capture Window", WS_VISIBLE , 0, 0, 200, 200, NULL, 0); if(!capDriverConnect (hwnd, 0)) MessageBox(NULL, "error", NULL,0); if(!capGrabFrameNoStop(hwnd)) MessageBox(NULL, "error", NULL,0); if(!capFileSaveDIB(hwnd, "cap.bmp")) MessageBox(NULL, "error", NULL,0); return 0; }
Funnily enough I did a little search on this board and look at what I found
i don't think most standard compilers support programmers with more than 4 red boxes - Misplaced
It is my sacred duity to stand in the path of the flood of ignorance and blatant stupidity... - quzah
Such pointless tricks ceased to be interesting or useful when we came down from the trees and started using higher level languages. - Salem
Thanks.
After I've got the bitmap in a DC, how can I save it as a bmp file on the disk?
Study the file format
Use WriteFile
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.