一个旋转算法:
const
rotation = 2/3*pi;
var
x,y : integer;
newx,newy : integer;
radius,a : real;
begin
for x:=1 to image1.Picture.Width do
begin
for y:=1 to image1.Height do
begin
radius:=Sqrt(Sqr(X)+Sqr(Y));
a:=Arctan(Y/X);
newx:=round(Radius*Cos(A+Rotation)+300);
newy:=round(Radius*Sin(A+Rotation)+300);
image2.Canvas.Pixels[newx,newy]:=image1.Canvas.Pixels[x,y];
end;
end;
end;
注:image1是原图
image2是旋转后的图