| View previous topic :: View next topic |
| Author |
Message |
malfunction Grandmaster Cheater Supreme
Reputation: 0
Joined: 30 Jan 2007 Posts: 1015 Location: http://www.behindthecorner.com/
|
Posted: Wed Feb 27, 2008 6:11 am Post subject: [DELPHI] Screen Capture |
|
|
Screen capturing is pretty easily done with delphi using the TCanvas and TBitmap objects.
1) open delphi
2) create a new console application (File->New->Other..., Console Application)
3) erase/delete all the code which is on the code sheet
4) add this code there:
| Code: | program Screencapture;
uses
Windows,
Graphics,
Forms,
Classes;
var
Canvas: TCanvas;
Picture: TBitmap;
begin
// Creating the TCanvas object
Canvas := TCanvas.Create;
// Attaching the handle to the desktop
Canvas.Handle := GetDC( 0 );
// Creating the TBitmap object
Picture := TBitmap.Create;
// Setting the picture size
Picture.Width := Screen.Width;
Picture.Height := Screen.Height;
// Copying the desktop into the Picture-object
Picture.Canvas.CopyRect( RECT( 0,0,Screen.Width,Screen.Height ), Canvas, RECT( 0,0,Screen.Width,Screen.Height ) );
// Releasing the desktop handle
ReleaseDC( 0, Canvas.Handle );
// Releasing/freeing the canvas
Canvas.Free;
// Saving the picture
Picture.SaveToFile( 'screen.bmp' );
// Releasing/freeing the picture
Picture.Free;
end. |
@Flamers and especially holyblah, this code I did not copy from any website, I wrote it my self.
_________________
|
|
| Back to top |
|
 |
jongwee Moderator
Reputation: 0
Joined: 28 Jun 2006 Posts: 1388 Location: Singapore
|
Posted: Wed Feb 27, 2008 6:13 am Post subject: |
|
|
Will you ever stop posting such things? People know how to google 'em. Gosh, I can just create a new project and copy paste the function I googled and say I wrote it myself. Ironic, eh?
_________________
|
|
| Back to top |
|
 |
malfunction Grandmaster Cheater Supreme
Reputation: 0
Joined: 30 Jan 2007 Posts: 1015 Location: http://www.behindthecorner.com/
|
Posted: Wed Feb 27, 2008 6:17 am Post subject: |
|
|
only thing is i wrote this one myself it has not been found on any website. I googled this myself and found some stuff like this but they were much more complicated and decided to make one myself. try find this exact same code on the web, I can promise you wont.
_________________
|
|
| Back to top |
|
 |
jongwee Moderator
Reputation: 0
Joined: 28 Jun 2006 Posts: 1388 Location: Singapore
|
Posted: Wed Feb 27, 2008 7:28 am Post subject: |
|
|
Lol by changing names of variables? Or by putting moar comments??!!
BTW: Why a console app?
_________________
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
|
| Back to top |
|
 |
malfunction Grandmaster Cheater Supreme
Reputation: 0
Joined: 30 Jan 2007 Posts: 1015 Location: http://www.behindthecorner.com/
|
Posted: Wed Feb 27, 2008 8:12 am Post subject: |
|
|
yes similar I said myself too I have found similar ones, but this has been written by me from start to beginning, no changes made to someother script.
_________________
|
|
| Back to top |
|
 |
colo Expert Cheater
Reputation: 1
Joined: 09 Apr 2005 Posts: 111
|
Posted: Wed Feb 27, 2008 8:57 am Post subject: Re: [DELPHI] Screen Capture |
|
|
| skyllakarean wrote: |
@Flamers and especially holyblah, this code I did not copy from any website, I wrote it my self. |
rofl
you had read a lot and had compressed some everything : P
|
|
| Back to top |
|
 |
HolyBlah Master Cheater
Reputation: 2
Joined: 24 Aug 2007 Posts: 446
|
Posted: Wed Feb 27, 2008 9:10 am Post subject: Re: [DELPHI] Screen Capture |
|
|
| skyllakarean wrote: | | @Flamers and especially holyblah, this code I did not copy from any website, I wrote it my self. |
As wiccaan said, similar code could be found in Google.
Not giving credits is like stealing the work of others.
Tip:
You can use the picture canvas instead of a new one's.
|
|
| Back to top |
|
 |
malfunction Grandmaster Cheater Supreme
Reputation: 0
Joined: 30 Jan 2007 Posts: 1015 Location: http://www.behindthecorner.com/
|
Posted: Wed Feb 27, 2008 10:18 am Post subject: Re: [DELPHI] Screen Capture |
|
|
| HolyBlah wrote: | | skyllakarean wrote: | | @Flamers and especially holyblah, this code I did not copy from any website, I wrote it my self. |
As wiccaan said, similar code could be found in Google.
Not giving credits is like stealing the work of others.
Tip:
You can use the picture canvas instead of a new one's. |
yes similar but not this one
_________________
|
|
| Back to top |
|
 |
|