Printing pictures

I have a database picture field (Firebird 1.5 blob subtype 0) and it have assigned .bmp or .jpg pictures.
I have a TfrPictureView and, if I set BlobType to btBMP and try to show .bmp pictures, I get a lot of "bitmap image is not valid" messageboxes but pictures are shown, (this error can be produced by empty picture fields in database).
If I set BlobType to btJPG ({define JPEG} is enabled), and I try to show .jpg pictures, I get a "JPEG error #53" and nothing is shown
If I try to show .jpg when BlobType is btJPG or I try to show .bmp when BlobType is btBMP I get an error too

What can I do to show both two .jpg and .bmp pictures stored in my database?

Comments

  • edited 5:29PM
    I think you can write in TfrReport.BeforePrint

    procedure TForm1.Doc1BeforePrint(Memo: TStringList; View: TView);
    begin
    if Memo.Count > 0 then
    if (Memo[0] = '[Picture]') and (View is TPictureView) then
    'Check the field is null here
    (View as TPictureView).Picture.Assign(Table1Picture);
    end;
  • edited 5:29PM
    THANKS A LOT!!, with your example and some more code, I have solved my problem, thankyou very much, I spent some days trying to make it work, but I couldn't, thanks again
  • edited 5:29PM
    1.Create a TfrPictureView in the frReportDesigner
    2.Set TfrPictureView.Memo Value = [Picture]
    3.Write write in TfrReport.BeforePrint
    like i said

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.