主题:图片怎么旋转???
救命a
[专家分:0] 发布于 2006-07-27 22:14:00
哪位大虾能帮我解决下 delphi中图片怎么旋转阿?
回复列表 (共1个回复)
沙发
wealthy [专家分:1840] 发布于 2006-07-28 09:40:00
procedure TMainForm.RotateImage;
var x,y : Integer;
TmpBitMap : TBitmap;
begin
TmpBitMap := TBitmap.Create;
try
TmpBitMap.Assign(ImageCert.Picture.Graphic);
with ImageCert do begin
Picture.Bitmap.Height := TmpBitMap.Width;
Picture.Bitmap.Width := TmpBitMap.Height;
for x:=0 to Height do
for y:=0 to Width do
Canvas.Pixels[TmpBitMap.Height-x,y] := TmpBitMap.Canvas.Pixels[y,x];
Height := TmpBitMap.Width;
Width := TmpBitMap.Height;
end;
finally
TmpBitMap.Free;
end;
end;
我来回复