1. Capturing the desktop image
- Posted by Chris Bensler <bensler at telus.net> Aug 22, 2001
- 394 views
Can anyone tell me how to capture the desktop image, including the taskbar, so that I can get the pixel data? I've looked in the win32API help files, and there is an example, but I can't for the life of me convert it to EU.. Just so you know, I'm not using win32lib.. Chris
2. Re: Capturing the desktop image
- Posted by euman at bellsouth.net Aug 22, 2001
- 378 views
I think you can hand BitBlt the coords and blit the screen coords rect to a compatible DC then from there do what you want with it.. Euman euman at bellsouth.net > Can anyone tell me how to capture the desktop image, including the taskbar, > so that I can get the pixel data? > I've looked in the win32API help files, and there is an example, but I can't > for the life of me convert it to EU.. > > Just so you know, I'm not using win32lib.. > > Chris > > > > >
3. Re: Capturing the desktop image
- Posted by Chris Bensler <bensler at telus.net> Aug 22, 2001
- 385 views
My main problem is getting the pixel data from the compatibleDC.. If anyone's familiar with Exotica.. you could understand what I'm trying to do.. I want to get the dektop image so I can simulate a non-fullscreen window/s I need to copy the pixel data to an exotica surface.. Chris . > I think you can hand BitBlt the coords and blit the screen > coords rect to a compatible DC then from there do what > you want with it.. > > Euman > euman at bellsouth.net > > > > Can anyone tell me how to capture the desktop image, including the taskbar, > > so that I can get the pixel data? > > I've looked in the win32API help files, and there is an example, but I can't > > for the life of me convert it to EU.. > > > > Just so you know, I'm not using win32lib.. > > > > Chris > > > > > > > > > > > > > > > >
4. Re: Capturing the desktop image
- Posted by Chris Bensler <bensler at telus.net> Aug 23, 2001
- 417 views
I can get that far, but then how do I retrieve the pixel data from hMemDC? Can I just peek the device directly? I can't utilize win32 structures in Exotica.. I don't know how anyways.. I'm sure there's a way... If I understand correctly, that WILL blit the desktop to my program window.. but I'm still not able to manipulate it.. Any contents of the window will be overwritten with the DirectX data.. If I can get the pixel data of the desktop, I can copy it to a DierectX drawing surface, and use it as my background.. Chris > Did you try: > > create a RECT structure. > > Desk_handle = GetDeskTop() > GetClientArea(Desk_handle, address_of_RECT) > > Then: > > DC = GetDC( hWnd ) > hMemDC = CreateCompatibleDC( hDC ) > hBckgrdBitmap = CreateCompatibleBitmap( hDC, rect.right, > rect.bottom ) > SelectObject( hMemDC, hBckgrdBitmap ) > BitBlt( hMemDC, 0, 0, rect.right, rect.bottom, hDC, 0, 0, SRCCOPY ) > DeleteDC( hMemDC ) > ReleaseDC( hWnd, hDC ) > > Bernie > > > > >
5. Re: Capturing the desktop image
- Posted by stabmaster_ at HOTMAIL.COM Aug 23, 2001
- 405 views
>I can get that far, but then how do I retrieve the pixel data from hMemDC? >Can I just peek the device directly? I can't utilize win32 structures in >Exotica.. I don't know how anyways.. I'm sure there's a way... >If I understand correctly, that WILL blit the desktop to my program >window.. >but I'm still not able to manipulate it.. Any contents of the window will >be >overwritten with the DirectX data.. >If I can get the pixel data of the desktop, I can copy it to a DierectX >drawing surface, and use it as my background.. > >Chris > Perhaps this can be of use: HBITMAP CreateDIBSection( HDC hdc, // handle of device context CONST BITMAPINFO *pbmi, // address of structure containing bitmap size, format, and color data UINT iUsage, // color data type indicator: RGB values or palette indices VOID **ppvBits, // pointer to variable to receive a pointer to the bitmap's bit values HANDLE hSection, // optional handle to a file mapping object DWORD dwOffset // offset to the bitmap bit values within the file mapping object );