You are not logged in. You can browse in the PowerBASIC Community, but you must click Login (top right) before you can post. If this is your first visit, check out the FAQ or Sign Up.
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.
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Comment