Einzelnen Beitrag anzeigen

mz23
(Gast)

n/a Beiträge
 
#7

AW: Bild um angegebene 90° 180° 270° drehen

  Alt 7. Mär 2012, 17:20
Delphi-Quellcode:
mirror a TImage Left-Right and Up-Down
by M.Z. March 5, 2012

{-mirror up-down-}
procedure TImageEdit.bMirrorUpDnClick(Sender: TObject);
var dx, dy : integer;
begin
dx:=imaDest.Width;
dy:=imaDest.Height;
imaDest.Canvas.CopyRect(Rect(0,0,dx,dy),
         imaDest.Canvas,Rect(0,dy,dx,0));
end;

{-mirror left-right-}
procedure TImageEdit.bMirrorLeRiClick(Sender: TObject);
var dx, dy : integer;
begin
dx:=imaDest.Width;
dy:=imaDest.Height;
imaDest.Canvas.CopyRect(Rect(0,0,dx,dy),
         imaDest.Canvas,Rect(dx,0,0,dy));
end;

{-rotating 180 degrees-}
procedure TImageEdit.bRot180Click(Sender: TObject);
var dx, dy : integer;
begin
dx:=imaDest.Width;
dy:=imaDest.Height;
imaDest.Canvas.CopyRect(Rect(0,0,dx,dy),
         imaDest.Canvas,Rect(dx,dy,0,0));
end;

{-we need: ImageEdit: TForm-}
{-         imaDest: TImage-}
{-         bMirrorUpDn, bMirrorLeRi, bTor180: TButton-}
  Mit Zitat antworten Zitat