2009-08-28 18:19:25 -04:00
|
|
|
unit Unit1;
|
|
|
|
|
|
|
|
{$mode objfpc}{$H+}
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
uses
|
|
|
|
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
|
|
|
|
StdCtrls, Client;
|
|
|
|
|
|
|
|
type
|
|
|
|
|
|
|
|
{ TForm1 }
|
|
|
|
|
|
|
|
TForm1 = class(TForm)
|
|
|
|
Button1: TButton;
|
|
|
|
procedure Button1Click(Sender: TObject);
|
|
|
|
private
|
|
|
|
{ private declarations }
|
|
|
|
public
|
|
|
|
{ public declarations }
|
|
|
|
end;
|
|
|
|
|
|
|
|
var
|
|
|
|
Form1: TForm1;
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
{ TForm1 }
|
|
|
|
|
|
|
|
procedure TForm1.Button1Click(Sender: TObject);
|
|
|
|
Var
|
|
|
|
Client: TClient;
|
|
|
|
w,h:integer;
|
2009-08-31 21:42:05 -04:00
|
|
|
bmp: TBitmap;
|
|
|
|
|
2009-08-28 18:19:25 -04:00
|
|
|
begin
|
|
|
|
Client := TClient.Create;
|
|
|
|
Client.MWindow.GetDimensions(w, h);
|
|
|
|
writeln(inttostr(w) + ' , ' + inttostr(h));
|
|
|
|
|
2009-08-31 21:42:05 -04:00
|
|
|
bmp := Client.MWindow.CopyClientToBitmap(0, 0, w, h);
|
|
|
|
//writeln(inttostr(bmp.Width));
|
|
|
|
bmp.SaveToFile('/tmp/test.bmp');
|
|
|
|
bmp.Free;
|
|
|
|
|
2009-08-28 18:19:25 -04:00
|
|
|
Client.Destroy;
|
|
|
|
end;
|
|
|
|
|
|
|
|
initialization
|
|
|
|
{$I unit1.lrs}
|
|
|
|
|
|
|
|
end.
|
|
|
|
|