Thema: Delphi Bitmap spiegeln

Einzelnen Beitrag anzeigen

GSE

Registriert seit: 4. Dez 2003
Ort: Chemnitz
8 Beiträge
 
Delphi 5 Professional
 
#4

Re: Bitmap spiegeln

  Alt 17. Dez 2003, 14:54
Hi,

Horizontal:
Delphi-Quellcode:
Procedure MirrorHorizontal(var Picture: TBitmap);
var BMP: TBitmap;
     i,j: integer;
begin
 BMP := TBitmap.Create;
 BMP.Assign(Picture);
 for i := BMP.Height-1 downto 0 do
  for j := BMP.Width-1 downto 0 do
   Picture.canvas.Pixels[Picture.Width-j, i] := BMP.canvas.Pixels[j, i];
 BMP.free;
end;
und Vertikal:
Delphi-Quellcode:
Procedure MirrorVertical(var Picture: TBitmap);
var BMP: TBitmap;
     i,j: integer;
begin
BMP := TBitmap.Create;
BMP.Assign(Picture);
for i := 0 to BMP.Height-1 do
  for j := 0 to BMP.Width-1 do
   Picture.canvas.Pixels[j, BMP.Height-i-1] := BMP.canvas.Pixels[j, i];
BMP.free;
end;
Sollte funktionieren hab´s jetzt aber nicht nochmal getestet, hab´s aus´m Kopf geschrieben da ich grad kein Delphi da hab!

mfg
GSE
In a world without walls and fenches, who needs Windows or Gates?
  Mit Zitat antworten Zitat