   Taking and saving a screenshot
  Hi,Basically, I want to take a screenshot and then save it as a jpg (or another browser readable file type), but there seems to be relatively little information about this on the net.I have found plenty of "Screenshot programs" but that's overkill, and besides, I want to run it from the command line, and learn by writing it 'myself' (I'm using MSVC++ 6).Basically, I'm doing a little experiment with controlling my pc from a remote web page, via apache and php. mouse clicks are sorted, but I still need to update the screenshot manually. (I can't find a way to do it directly from php either)Thanks a lot,  Nick[edited by - Xgkkp on February 6, 2004 10:05:09 AM]
  Use GetPixel() and SetPixel() and build a bitmap.  ;  Creating a screenshot is usually done by using GetDesktopWindow() to acquire a handle to the desktop. The you snag the desktop''s device context and create a compatible device context (usually via a memory bitmap) and BitBlt() to the new device context with SRCCOPY. If you use a MFC CImage class for destination device context you can just use CImage::Save() to write the image to a file. CImage::Save() should support BMP, PNG, JPEG and GIF file formats. ;  www.codeproject.comsearch for "Screen Capture";  The following creates a handle to a device context with the screen''s current image, which you can then BitBlt() to your own HDC and do stuff with:HDC hDCScreen = CreateDC("DISPLAY", NULL, NULL, NULL);... (Do stuff with hDCScreen)DeleteDC(hDCScreen); ;  http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/bitmaps_5a5h.asp 