No announcement yet.

Screen Cap ?

  • Filter
  • Time
  • Show
Clear All
new posts

  • Screen Cap ?

    I Want Capture My Desktop Screen Real Time Avi Files Or Data
    How To ?


  • #2
    Here are the steps you need:
    1. Use the GetDC to determine the hDC value of the object you want to capture. This can be the whole screen, determine the hWnd value with GetDesktopWindow().
    2. Use the GetWindowRect to get the RECT dimensions
    3. Create a memory device context for the copy process with CreateCompatibleDC
    4. Create a bitmap and place it in the memory DC with CreateCompatibleBitmap and than get a handle with SelectObject
    5. Get the raster capabilities with GetDeviceCaps(hDC, %RASTERCAPS) and determine the pallet support
    6. Get the size of palette also with GetDeviceCaps(hDC, %SIZEPALETTE)
    7. If the screen has a palette make a copy and realize it using LOGPALETTE, and GetSystemPaletteEntries, CreatePalette, SelectPalette, RealizePalette
    8. Copy the on-screen image into the memory DC using BitBlt
    9. Remove the new copy of the on-screen image with SelectObject
    10. If the screen has a palette get back the palette that was selected in previously with SelectPalette
    11. Release the device context resources back to the system with DeleteDC and ReleaseDC
    12. Finally with CreateBitmapPicture you will get the copy you needed.