如何实现JPEG图像旋转90度(100分)

Z

zjqpost

Unregistered / Unconfirmed
GUEST, unregistred user!
1.如何实现JPEG图像旋转90度?
2.如何实现JPEG图像文件转为BMP图像
 
photoshop
1,menu--Image--Rotate Canvas--180
2,Save as 选中 保存格式为 BMP即可
 
将image1中的图像旋转90度放到image2中,
procedure TForm1.Button1Click(Sender: TObject);
var
i,j: integer;
begin

//确定旋转后位图的大小
image2.Picture.Bitmap.Height:=image1.picture.width;
image2.Picture.Bitmap.Width:=image1.picture.height;
for i:=0 to image1.Heightdo

for j:=0 to image1.Widthdo

image2.canvas.Pixels[(-i+image1.Height),j]:=image1.canvas.Pixels[j,i];
end;
 
bitmap1.Height := Bitmap2.Width;
bitmap1.Width := Bitmap2.Height;
for y := 0 to Bitmap2.Width - 1do

begin

New := bitmap1.ScanLine[y];
for x := 0 to Bitmap2.Height - 1do

begin

Current := Bitmap2.ScanLine[x];
New[x] := Current[y];
end;

end;

end;

 
按以上方法就可以了,但是,我为什么不来早些????
 
<<如何实现JPEG图像文件转为BMP图像
用流。
 
to cgh0717
是啊,为什么我也不来早些,旋转90度没什么,就是对角象素换换而已,如果旋转5度,10度……
那就比较麻烦了,最好能编一个旋转任意角度的算法,形如:
function RotateBitmap(ABitmap: TBitmap;
Angle: Integer): TBitmap;
你们说呢?
 
90 180 270 最快. 其他角度慢, 函数最好分开写, 速度优化的问题.
 

太多方法了,只要是图片处理软件都可以轻松搞定!^_^

是啊,为什么我也不来早些,旋转90度没什么,就是对角象素换换而已,如果旋转5度,10度……
那就比较麻烦了,最好能编一个旋转任意角度的算法,形如:
function RotateBitmap(ABitmap: TBitmap;
Angle: Integer): TBitmap;
你们说呢?
用photoshop的自由旋转即可,用COREDRAW也可以,很简单的。
 
接受答案了.
 
顶部