给你一个我的代码,例子:如果你要30度旋转。du:=30*pi/180;
function sy_rotate(sm:Tbitmap;du:extended):Tbitmap;
var
i,j:integer;
dest:Tbitmap;
x,y:integer;
x0,y0:integer;
temp_sin,temp_cos:extended;
begin
dest:=Tbitmap.Create;
dest.Width:=sm.Width;
dest.Height:=sm.Height;
y0:=floor(sm.Height/2);
x0:=floor(sm.width/2);
for i:=0 to sm.Height-1 do
begin
temp_sin:=(i-y0)*sin(du);
temp_cos:=(i-y0)*cos(du);
for j:=0 to sm.Width-1 do
begin
x:=floor((j-x0)*cos(du)-temp_sin+x0+0.5);
y:=floor((j-x0)*sin(du)+temp_cos+y0+0.5);
if (x=236)and (y=132) then showmessage('cch');
if (x>=0) and (y>=0) and (x<=sm.Width-1)and(y<=sm.Height-1) then
begin
dest.Canvas.Pixels[x,y]:=sm.Canvas.Pixels[j,i];
end;//end if x,y,....
end;//end for j;
end;//end for i;
result:=dest;
end;