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

BMP Graphic issue

edited September 2003 in General
Hi,

I am using HiComponents TImageEn graphic components. When I save a graphic
into the database I save it as a bmp as follows:

ImageIO.Params.BMP_Version:=ioBMP_BMOS2V2

When trying to display a graphic in a report using Windows 98, the 'Invalid
Image' error appears. However if I display the ReportBuilder report using
another PC that is not Windows 98 then the report and the graphic
shows/prints fine.

From this I assume the graphic gets saved into the database fine, but
Windows 98 in conjunction with ReportBuilder has troubles trying to decipher
it.

Anyone aware of this type of issue and how I might resolve it?

Regards

Alex

Comments

  • edited September 2003
    Hi Alex,

    If this is occuring on one machine and not another, this could be a printer
    driver issue. Are you able to load the image from the database to a normal
    Delphi application without the use of ReportBuilder? If so, check to see
    that you have the latest printer driver for the your default printer and see
    if that helps. You may also want to try installing the HP LaserJet 4
    printer driver and running your application with that to see if the results
    change.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited September 2003
    Hi Nico,

    It is not a printer driver issue, it is consistent on every Win98 PC we have
    tried. This is the response I got from HiComponents:

    'the extended BMP format (OS2 format) is not supported by Win98
    (ReportBuilder and Delphi probably uses operating system calls to read bmp
    format, instead ImageEn uses internal routines).
    I'm sorry , but I don't know a solution for this problem (try another
    format?)'

    So I guess I'm stuck unless there's a way to tell ReportBuilder to use
    internal routines to read bmp format. Might have to change the format I
    save. Any suggestions on which is the best graphic format to use (that
    won't lose quality, and stores details such as width, height and DPI) and is
    supported by ReportBuilder.

    Regards

    Alex



  • edited September 2003
    Hi Alex,

    ReportBuilder uses the same internal routines to read a bitmap than TImage
    does in Delphi. It may be possible to get the same image quality out of a
    JPEG image with compression turned off. Other than that a Window Meta File
    (.wmf) would be your best bet.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited September 2003
    Hi Nico,

    Thanks for your patience. I have also been advised that TIFF and PNG are
    good formats to use. Are these supported by ReportBuilder?

    Regards

    Alex

  • edited September 2003
    Hi Alex,

    ---------------------------------------------------------------------
    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.


    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.