unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TForm1 =
class(TForm)
Image1: TImage;
Image2: TImage;
Button2: TButton;
procedure FormCreate(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
oben : Integer;
Bitmap: TBitmap;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
oben := 0;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
pict1:
string;
MyRect: TRect;
b,h, h2,w: Integer;
begin
form1.Top := 0;
form1.Left := 0;
form1.Height := 768;
form1.Width := 1024;
pict1 := '
1.bmp';
Image1.picture.LoadFromFile(pict1);
Bitmap := TBitmap.Create;
try
Bitmap.LoadFromFile(pict1);
h := Bitmap.Height;
w := Bitmap.Width;
//ShowMessage(IntToStr(h) + ' ' + IntToStr(w));
h2 := 10 + oben;
MyRect := Rect(0,0,w,h2 + Round(h/2));
Image2.Height := h;
Image2.Width := w;
Image2.Canvas.CopyRect(MyRect,Bitmap.Canvas,MyRect);
Image2.Refresh;
oben := oben + 10;
finally
Bitmap.Free;
end;
end;
end.