/Gedemin/IBX/GraphicSupportIB.pas

http://gedemin.googlecode.com/ · Pascal · 47 lines · 22 code · 8 blank · 17 comment · 0 complexity · b2dda1a0c5c2dac2a4f75d92fa7a0d21 MD5 · raw file

  1. {********************************************************}
  2. { }
  3. { JPEG-Support for Delphi (Design- and Runtime) }
  4. { For IBExpress users }
  5. { }
  6. { Copyright (c) 2002 Robert Kuhlmann, Bremen, Germany }
  7. { with quotations from unit DB.pas (VCL sources) }
  8. { copyright (c) 1995, 02 Borland Corporation }
  9. { }
  10. { For questions or comments please contact }
  11. { robert.kuhlmann1@ewetel.net }
  12. { }
  13. {********************************************************}
  14. unit GraphicSupportIB;
  15. interface
  16. uses
  17. GraphicSupport;
  18. procedure Register;
  19. implementation
  20. uses
  21. Classes, db, IBCustomDataset;
  22. procedure Register;
  23. begin
  24. { Register gets called by the IDE, when the package is loaded via LoadPackage,
  25. so the replacement can happen here to ensure JPEG support at designtime. }
  26. TFieldClass(Pointer(@DefaultFieldClasses[ftBlob])^) := TEnhBlobField;
  27. TFieldClass(Pointer(@DefaultFieldClasses[ftGraphic])^) := TEnhGraphicField;
  28. RegisterClass(TEnhBlobField);
  29. RegisterClass(TEnhGraphicField);
  30. end;
  31. initialization
  32. { This part ensures JPEG support for applications that use IBExpress instead
  33. of standard DB. For details take a look at the readme-file. }
  34. TFieldClass(Pointer(@DefaultFieldClasses[ftBlob])^) := TEnhBlobField;
  35. TFieldClass(Pointer(@DefaultFieldClasses[ftGraphic])^) := TEnhGraphicField;
  36. finalization
  37. TFieldClass(Pointer(@DefaultFieldClasses[ftBlob])^) := TBlobField;
  38. TFieldClass(Pointer(@DefaultFieldClasses[ftGraphic])^) := TGraphicField;
  39. end.