JPEG错误
提示:这里可以添加技术概要
核心源码
procedure TForm1.Button1Click(Sender: TObject);
var
Picture: TPicture;
ErrorString: string;
begin
Picture := TPicture.Create;
ErrorString := ‘’;
try
try
Picture.LoadFromFile(‘VeryBad.JPG’);
except
on E: Exception do
ErrorString := E.Message;
end;
Image1.Picture := Picture
finally
if ErrorString <> ‘’ then
begin
ErrorString := Trim(RightStr(ErrorString, 4));
ErrorString := Copy(ErrorString, 2, Length(ErrorString) - 1);
ShowMessage(cJpegErrors[Strtoint(ErrorString)]);
end;
Picture.Free
end
end;