H
hs-kill
Unregistered / Unconfirmed
GUEST, unregistred user!
var
jpg:TJPEGImage;
var
pic:TPicture;
bmp:TBitmap;
begin
with opendialog1 do
if Execute then
begin
bmp:=tbitmap.Create;
pic:=TPicture.Create;
try
pic.LoadFromFile(filename);
jpg.Assign(pic); //这里如果后面跟着执行jpg.savetofile就是正确的图像
bmp.Assign(jpg); //但是这里bmp.assign以后还是jpg上次获得的图像不是新assign以后的......jpg刚create完正确,第2次就不对了......MD
image1.Picture.Assign(bmp);
finally
pic.Free;
bmp.Free;
end;
end;
end;
jpg:TJPEGImage;
var
pic:TPicture;
bmp:TBitmap;
begin
with opendialog1 do
if Execute then
begin
bmp:=tbitmap.Create;
pic:=TPicture.Create;
try
pic.LoadFromFile(filename);
jpg.Assign(pic); //这里如果后面跟着执行jpg.savetofile就是正确的图像
bmp.Assign(jpg); //但是这里bmp.assign以后还是jpg上次获得的图像不是新assign以后的......jpg刚create完正确,第2次就不对了......MD
image1.Picture.Assign(bmp);
finally
pic.Free;
bmp.Free;
end;
end;
end;