Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

.tif files

edited March 2003 in General
My Interbase database contains blob fields that holds .tif files.
To allow the user to see these images, an OCX was used (TImgEdit from kodak
software(Imaging)).
This component reads the data only from a file, so in the code, there is a
blobfield.savetofile and then the image file is assigned to the OCX. This
way, the image is displayed.

Now I need to print them with Report Builder. I don't know where to begin.
I tried to use GraphicEx library to allow TImage to load .tif files, but it
appears that the algorithm that is used is not supported. I have no control
on the image format.

I thought using the clipboard to copy the content of the OCX while the
report gets generated, but I'm not able to copy from the OCX at all (it says
that no annotation has been set...). Anyway, I don't think it is the way to
go.

Do I need a special library to print those .tif files?

Comments

  • edited March 2003
    RB doesn't support this image natively. However, you can rely on TPicture to
    try to load any image, though the TIF format is not supported by TPicture
    either. You will need to use another 3rd party component to load a TIF image
    in a Delphi control, then either create custom image support in a TGraphic
    descendent, as we have for GIF and JPEG in RB as shown inthe article below,
    or convert the TIF to a bitmap and load it into RB as a Bitmap. I surfed
    Torry's Delphi pages and did see some Delphi TIF image components. Here is
    an example where a TPicture is used by a JITPipeline to load images.

    http://www.digital-metaphors.com/tips/LoadImageVIAJit.zip

    ---------------------------------------------------------------------
    Article: ReportBuilder Image Support
    ---------------------------------------------------------------------

    ReportBuilder natively supports .bmp, .jpeg, .wmf, .ico image formats.

    ReportBuilder has an open architecture that supports any TGraphic
    descendant.

    For example, ReportBuilder ships with a freeware component called GIFImage
    that can be used with ReportBuilder to print .gif images. (see the main
    report demo app for an example.)

    There is another freeware component called GraphicEx that
    supports several additional formats - including tiff, targa, and autodesk.

    It can be downloaded from:

    http://www.lischke-online.de/Graphics.html


    ReportBuilder can easily support TGraphic descendants
    with a simple register call.

    Below is the code to our ppGIF.pas unit which
    'uses' and registers the freeware GIFImage component.


    {********************************************************************}
    { }
    { ReportBuilder Report Component Library }
    { }
    { Copyright (c) 1996, 2000 Digital Metaphors Corporation }
    { }
    {********************************************************************}

    unit ppGIF;

    interface

    {$I ppIfDef.pas}

    uses
    ppCtrls, GIFImage;

    implementation

    {***************************************************************
    *
    ** I N I T I A L I Z A T I O N / F I N A L I Z A T I O N
    *
    {****************************************************************}

    initialization

    ppRegisterGraphicClass('GIF', TGIFImage);

    finalization

    ppUnRegisterGraphicClass(TGIFImage);

    end.



    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.