home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2001 October
/
Chip_2001-10_cd1.bin
/
zkuste
/
delphi
/
kolekce
/
d56
/
TDSOFT.ZIP
/
TDScreenStamp.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
2001-04-06
|
2KB
|
67 lines
{*******************************************************}
{ }
{ TDSoft Visual Component Library }
{ }
{ Copyright (c) 2001 Daniele Teti }
{ }
{-------------------------------------------------------}
{ For suggest, request, bug or only for sport: }
{ Daniele_Teti@hotmail.com }
{-------------------------------------------------------}
{ }
{ }
{*******************************************************}
unit TDScreenStamp;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
{$R *.DCR}
type
TTDScreenStamp = class(TComponent)
private
{ Private declarations }
protected
{ Protected declarations }
public
{ Public declarations }
function CaptureScreen:TBitmap;
published
{ Published declarations }
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('TDSoft', [TTDScreenStamp]);
end;
{ TTDScreenStamp }
function TTDScreenStamp.CaptureScreen: TBitmap;
var
DC : HDC;
ABitmap:TBitmap;
begin
DC := GetDC (GetDesktopWindow);
ABitmap:=TBitmap.Create;
try
ABitmap.Width := GetDeviceCaps (DC, HORZRES);
ABitmap.Height := GetDeviceCaps (DC, VERTRES);
BitBlt(ABitmap.Canvas.Handle, 0, 0, ABitmap.Width,
ABitmap.Height,DC, 0, 0, SRCCOPY);
finally
ReleaseDC (GetDesktopWindow, DC);
end;
Result:=ABitmap;
end;
end.