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

How to improve quality when resizing images?

edited February 2006 in General
I print a logo in the header of every page.
The logo looks good if it is displayed in it's original size.

If the report-preview (TppViewer) is resized then the image also
should be resized. This results in really bad quality.

How can i improve the quality?
- Can i set a resize-method with better quality?
- Can i draw an image by code?
- Can i change the image when the image-control is resized?
- ... any other ideas?

regards,

josef

Comments

  • edited February 2006
    Hi Josef,

    ReportBuilder uses the Delphi StretchDraw routine to draw a scaled image to
    the screen. One thing you might try is setting the DirectDraw property of
    the image to True. This tends to help.

    Another option may be to use the TppViewer.OnResize event to re-assign
    another image.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

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

    For this reason we use ImageEn from HiComponents (www.hicomponents.com). We
    have written wrapper around it and use it's resize methods - support for
    many different resize filters.
    Works great and without problems. Somehing like:

    TdoppImage = class(TppImage)
    private
    FImageEnIO: TImageEnIO;
    FImageEnIOProc: TImageEnProc;
    protected
    procedure PictureMenuClick(Sender: TObject);
    public
    procedure PopupMenuClick(Sender: TObject); //override;
    constructor Create(aOwner: TComponent); override;
    destructor Destroy; override;
    end;

    in the implementation is used our own code for loading image from file and
    dynamically resizing it to correct size. The DB version is a little
    complicated, but it works. It can be easily updated to support image resize
    while resizing TdoppImage - but we didn't need that.

    Petr Slipek


    "josef" p?se v diskusn?m pr?spevku
This discussion has been closed.