1. Capturing the desktop image

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

new topic     » topic index » view message » categorize

2. Re: Capturing the desktop image

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
> 
> 
> 
> 
>

new topic     » goto parent     » topic index » view message » categorize

3. Re: Capturing the desktop image

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
> >
> >
> >
> >
> >
>
>
>
>
>
>

new topic     » goto parent     » topic index » view message » categorize

4. Re: Capturing the desktop image

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
>
>
>
>
>

new topic     » goto parent     » topic index » view message » categorize

5. Re: Capturing the desktop image

>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
   );

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu