procedure MirrorV(AImage: TImage);
var
lBmp: TBitmap;
begin
lBmp := TBitmap.Create;
try
lBmp.Assign(AImage.Picture.Graphic);
StretchBlt(lBmp.Canvas.Handle,
0,
0,
lBmp.Width,
lBmp.Height,
lBmp.Canvas.Handle,
0,
lBmp.Height,
lBmp.Width,
-lBmp.Height,
SRCCOPY);
AImage.Picture.Assign(lBmp);;
finally
lBmp.Free;
end;
end;
procedure MirrorH(AImage: TImage);
var
lBmp: TBitmap;
begin
lBmp := TBitmap.Create;
try
lBmp.Assign(AImage.Picture.Graphic);
StretchBlt(lBmp.Canvas.Handle,
0,
0,
lBmp.Width,
lBmp.Height,
lBmp.Canvas.Handle,
lBmp.Width,
0,
-lBmp.Width,
lBmp.Height,
SRCCOPY);
AImage.Picture.Assign(lBmp);;
finally
lBmp.Free;
end;
end;
Beispiel :
procedure TForm1.Button1Click(Sender: TObject);
begin
MirrorH(Image1);
Mirrorv(Image1);
end;
Keine Kommentare:
Kommentar veröffentlichen