救命啊 bmp 旋轉
psw 2004-07-20 02:26:03 救命啊 !
有那位大哥指點一下.
procedure Rotate90(const Bitmap: TBitmap);
var
i, j: Integer;
rowIn, rowOut: PRGBTriple;
Bmp: TBitmap;
Width, Height: Integer;
begin
Bmp := TBitmap.Create;
Bmp.Width := Bitmap.Height;
Bmp.Height := Bitmap.Width;
Width := Bitmap.Width - 1;
Height := Bitmap.Height - 1;
for j := 0 to Height do
begin
rowIn := Bitmap.ScanLine[j];
for i := 0 to Width do
begin
rowOut := Bmp.ScanLine[i];
Inc(rowOut, Height - j);
rowOut^ := rowIn^;
Inc(rowIn);
end;
end;
Bitmap.Assign(Bmp);
end;
上面是一段將bmp圖形旋轉90度的function。為什麼只是底色有旋轉中間的圖形都不見了..
先謝謝各位了