Question
“How can I use a JITPipeline to provide access to a DBImage component on my report?”
Solution
The following example implements the JITPipeline GEtFieldAsPicture event to access Image data. For this example the image is loaded from a file. You could also implement a solution that loads images from other sources such a TImage on a form or a TImageList.
Download: ImageViaJIT.zip
Sample Delphi code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
procedure TForm1.FormCreate(Sender: TObject); begin FPicture := TPicture.Create; end; procedure TForm1.FormDestroy(Sender: TObject); begin FPicture.Free; end; function TForm1.ppJITPipeline1GetFieldAsPicture(aFieldName: String): TPicture; begin if aFieldName = 'Graphic' then FPicture.MetaFile.LoadFromFile(TppFileUtils.GetApplicationFilePath + 'w2.wmf'); Result := FPicture; end; |