Thema: Delphi JPEG-Fehler: #41

Einzelnen Beitrag anzeigen

Benutzerbild von dizzy
dizzy

Registriert seit: 26. Nov 2003
Ort: Lünen
1.932 Beiträge
 
Delphi 7 Enterprise
 
#3

Re: JPEG-Fehler: #41

  Alt 11. Feb 2004, 14:08
Hi! Willkommen in der DP! (Delphi-Groups reichen net mehr? )

Ein kleiner Auszug aus dem BDN:

Zitat:
If you have used the TJpegImage class you may be familiar with the "JPEG error #xx" error that comes up on occasion. You may want to know exactly what went wrong, and how to get more information based on that number.

Luckily, the TJpegImage pascal source is included on the Delphi CD. Looking at the source, you will notice that it is a wrapper around some C code. There is one particular file called "jerror.h" which contains an enumeration of error strings. Based on the offset in this enum, you can find out what a given error number means.

For ease of use, I converted the "jerror.h" file to pascal in the unit JpegErrors.pas. To use this unit, simply reference the string array cJpegErrors, passing a given error number to find the error string, such as:

Label1.Caption := cJpegErrors[StrToInt(Edit1.Text)]
Note that the JpegErrors.pas unit was based on the Jpeg source that comes with Delphi 5. If the order of the error messages in "jerror.h" ever changes, the JpegErrors.pas will not by in sync with it and has to be updated.
Dann findest du zu mindest heraus, was das für ein Fehler ist.
Alternativ könnte man mit Resourcen arbeiten. Die lassen sich, so wie ich das mal las, auch nachträglich zur Laufzeit modifizieren. Wie genau, müsste bei Bedarf gesucht werden. Ich will nix falsches sagen


gruss,
dizzy
Fabian K.
INSERT INTO HandVonFreundin SELECT * FROM Himmel
  Mit Zitat antworten Zitat