PageRenderTime 15ms CodeModel.GetById 8ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/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
15unit GraphicSupportIB;
16
17interface
18
19uses
20  GraphicSupport;
21
22procedure Register;
23
24implementation
25
26uses
27  Classes, db, IBCustomDataset;
28
29procedure Register;
30begin
31  { Register gets called by the IDE, when the package is loaded via LoadPackage,
32    so the replacement can happen here to ensure JPEG support at designtime. }
33  TFieldClass(Pointer(@DefaultFieldClasses[ftBlob])^) := TEnhBlobField;
34  TFieldClass(Pointer(@DefaultFieldClasses[ftGraphic])^) := TEnhGraphicField;
35  RegisterClass(TEnhBlobField);
36  RegisterClass(TEnhGraphicField);
37end;
38
39initialization
40  { This part ensures JPEG support for applications that use IBExpress instead
41    of standard DB. For details  take a look at the readme-file. }
42  TFieldClass(Pointer(@DefaultFieldClasses[ftBlob])^) := TEnhBlobField;
43  TFieldClass(Pointer(@DefaultFieldClasses[ftGraphic])^) := TEnhGraphicField;
44finalization
45  TFieldClass(Pointer(@DefaultFieldClasses[ftBlob])^) := TBlobField;
46  TFieldClass(Pointer(@DefaultFieldClasses[ftGraphic])^) := TGraphicField;
47end.