 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Romain Chagot Guest
|
Posted: Fri Jul 25, 2003 6:19 pm Post subject: screenshots |
|
|
hi !
i hope i'm asking in the good category...
is there a way of taking pictures of the full screen (or desktop) ?
in CLX applications or at least with the VCL...
thanx
|
|
| Back to top |
|
 |
Maynard Philbrook Guest
|
Posted: Fri Jul 25, 2003 6:45 pm Post subject: Re: screenshots |
|
|
Var
C :Tcanvas;
begin
C := TCanvas.Create;
C.handle := GetDC(0);
// now the C canvas points to your whole screen.
when done you must release the handle
ReleaseDC(0,C.Handle);
c.free;
////
Romain Chagot wrote:
| Quote: | hi !
i hope i'm asking in the good category...
is there a way of taking pictures of the full screen (or desktop) ?
in CLX applications or at least with the VCL...
thanx
|
--
To See what real programmers do in their spare time visit
http://jamie12.home.mindspring.com
home of PC bit software ..
Please send comments about my work .
|
|
| Back to top |
|
 |
Poster Guest
|
Posted: Fri Jul 25, 2003 6:47 pm Post subject: Re: screenshots |
|
|
Check windows sdk, there is a source (albeit in C++) that explains this. Easily translated to pascal too.
"Romain Chagot" <romain.chagot (AT) free (DOT) fr> wrote:
| Quote: | hi !
i hope i'm asking in the good category...
is there a way of taking pictures of the full screen (or desktop) ?
in CLX applications or at least with the VCL...
thanx
|
|
|
| Back to top |
|
 |
Romain Chagot Guest
|
Posted: Fri Jul 25, 2003 7:24 pm Post subject: Re: screenshots |
|
|
where can i find this (windows SDK) ???
that doesn't solve the pb for Linux... :(
"Poster" <none (AT) here (DOT) yet> a écrit dans le message de news:
3f217b31$1 (AT) newsgroups (DOT) borland.com...
| Quote: |
Check windows sdk, there is a source (albeit in C++) that explains this.
Easily translated to pascal too.
|
|
|
| Back to top |
|
 |
Ignacio Vazquez Guest
|
Posted: Fri Jul 25, 2003 7:29 pm Post subject: Re: screenshots |
|
|
"Romain Chagot" <romain.chagot (AT) free (DOT) fr> wrote in message
[email]3f2183e8 (AT) newsgroups (DOT) borland.com[/email]...
| Quote: | where can i find this (windows SDK) ???
|
http://www.microsoft.com/msdownload/platformsdk/sdkupdate/
| Quote: | that doesn't solve the pb for Linux...
|
The X Window System is a whole other kettle of fish. Start here:
http://www.x.org/
Cheers,
Ignacio
|
|
| Back to top |
|
 |
Romain Chagot Guest
|
Posted: Fri Jul 25, 2003 10:10 pm Post subject: Re: screenshots |
|
|
i found the example and i convert it into pascal...
but i would like to put datas into a TBitmap... is it possible ? and how can
i do that ?
i saw function GetObject but it doesn't seam to work...
var hdcScreen: HDC;
hdcCompatible: HDC;
hbmScreen: HBITMAP;
hSelectObject: HGDIOBJ;
bmp: TBitmap;
begin
bmp := TBitmap.Create;
bmp.width := 1280; //static values just for test
bmp.height := 1024;
hdcScreen := CreateDC('DISPLAY', nil, nil, nil);
hdcCompatible := CreateCompatibleDC(hdcScreen);
hbmScreen := CreateCompatibleBitmap(hdcScreen,
GetDeviceCaps(hdcScreen, HORZRES),
GetDeviceCaps(hdcScreen, VERTRES));
if hbmScreen = 0 then
messagedlg('hbmScreen', mtError, [mbOK], 0);
hSelectObject := SelectObject(hdcCompatible, hbmScreen);
if (hSelectObject = NULLREGION) or (hSelectObject = GDI_ERROR) then
messagedlg('Compatible Bitmap Selection', mtError, [mbOK], 0);
if not BitBlt(hdcCompatible,
0, 0,
bmp.Width, bmp.Height,
hdcScreen,
0, 0,
SRCCOPY) then
messagedlg('Screen to Compat Blt Failed', mtError, [mbOK], 0);
////////////////// what must i do there ???? //////////////////
DeleteObject(hbmScreen);
DeleteDC(hdcCompatible);
DeleteDC(hdcScreen);
bmp.Free;
end;
|
|
| Back to top |
|
 |
Ignacio Vazquez Guest
|
Posted: Fri Jul 25, 2003 10:17 pm Post subject: Re: screenshots |
|
|
"Romain Chagot" <romain.chagot (AT) free (DOT) fr> wrote in message
[email]3f21aaed (AT) newsgroups (DOT) borland.com[/email]...
| Quote: | ////////////////// what must i do there ???? //////////////////
|
Try:
TBitmap.Canvas.Handle:=hdcCompatible;
Cheers,
Ignacio
|
|
| Back to top |
|
 |
Romain Chagot Guest
|
Posted: Fri Jul 25, 2003 10:34 pm Post subject: Re: screenshots |
|
|
thanks a lot ! it's working !
|
|
| Back to top |
|
 |
Romain Chagot Guest
|
Posted: Fri Jul 25, 2003 10:39 pm Post subject: Re: screenshots |
|
|
thanx for your unit... i'm going to try it right now ! :)
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|