M
mythank
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.N2Click(Sender: TObject);
var
filename:ansistring;
m1,m2:tbitmap;
r1:trect;
begin
if OpenDialog1.Execute then
begin
filename:=OpenDialog1.FileName;
image1.Picture.LoadFromFile(filename);
m1:=tbitmap.Create;
m2:=tbitmap.Create;
m1.Assign(image1.Picture);
with r1 do
begin
top:=0;
left:=0;
right:=image1.Width div 2;
bottom:=image1.Height div 2;
end;
m2.Canvas.CopyRect(r1,m1.Canvas,r1);
image2.Picture.Assign(m2);
end;
end;
var
filename:ansistring;
m1,m2:tbitmap;
r1:trect;
begin
if OpenDialog1.Execute then
begin
filename:=OpenDialog1.FileName;
image1.Picture.LoadFromFile(filename);
m1:=tbitmap.Create;
m2:=tbitmap.Create;
m1.Assign(image1.Picture);
with r1 do
begin
top:=0;
left:=0;
right:=image1.Width div 2;
bottom:=image1.Height div 2;
end;
m2.Canvas.CopyRect(r1,m1.Canvas,r1);
image2.Picture.Assign(m2);
end;
end;