G
gouer
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TMainFrm.JpgToBmp(szFilename:string);
var
Jpg:Tjpegimage;
bmp:Tbitmap;
begin
Jpg:=Tjpegimage.Create;
bmp:=Tbitmap.create;
try
Jpg.LoadFromFile(szFilename);
except
Jpg.Free;
Exit;
end;
Bmp.Width:=Jpg.Width;
Bmp.Height:=Jpg.Height;
Bmp.Canvas.Draw(0,0,Jpg);//这里等的时间最长
Jpg.Free;
CurImage.Picture.Bitmap:=bmp;
bmp.free
end;
var
Jpg:Tjpegimage;
bmp:Tbitmap;
begin
Jpg:=Tjpegimage.Create;
bmp:=Tbitmap.create;
try
Jpg.LoadFromFile(szFilename);
except
Jpg.Free;
Exit;
end;
Bmp.Width:=Jpg.Width;
Bmp.Height:=Jpg.Height;
Bmp.Canvas.Draw(0,0,Jpg);//这里等的时间最长
Jpg.Free;
CurImage.Picture.Bitmap:=bmp;
bmp.free
end;