f



[wx 2.6.0, Windows XP/Linux, Dev-CPP] Make a screenshot (with Device Contexts?)

Hi,
Is it possible with wxWidgets 2.6.0 to make screenshots?
One method i found with GDI, but thats not portable:
-------------------------------------------------------------------------
// get a handle to the Desktop Device Context, and create a
// compatible DC to copy into
HDC hdc = GetDC(NULL);
HDC hDest = CreateCompatibleDC(hdc) ;

// get the height and width of the screen
// (multiple Monitors? see notes)
int height = GetSystemMetrics(SM_CYVIRTUALSCREEN ) ;
int width = GetSystemMetrics(SM_CXVIRTUALSCREEN) ;

// create a bitmap,
HBITMAP hbDesktop = CreateCompatibleBitmap( hdc, width, height ) ;

// associate our own Device Context to the bitmap
SelectObject(hDest, hbDesktop );

// copy from one DC to the other
BitBlt( hDest, 0,0, width, height, hdc, 0, 0, SRCCOPY) ;
-------------------------------------------------------------------------
Can you do that with wxWidgets also?
(look here: http://www.thejumps.myby.co.uk/kevin/pc/2004/09/screen-capture-with-gdi-and-gdi-with.html)

Christian
__________________________________________________________
Mit WEB.DE FreePhone mit hoechster Qualitaet ab 0 Ct./Min.
weltweit telefonieren! http://freephone.web.de/?mc=021201


---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wx-users-help@lists.wxwidgets.org

0
ChristianHirche
6/4/2005 4:49:07 PM
comp.soft-sys.wxwindows 21076 articles. 0 followers. Post Follow

1 Replies
265 Views

Similar Articles

[PageSpeed] 9


Christian Hirche wrote:
> Hi,
> Is it possible with wxWidgets 2.6.0 to make screenshots?

wxScreenDC ??
chris

---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wx-users-help@lists.wxwidgets.org

0
biol75
6/4/2005 6:12:19 PM
Reply: