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

TppImage

edited May 2004 in General
How can I do for load a picture in a
TppImage component a run-time?

Moro

Comments

  • edited May 2004
    Hi Moro,

    1. If you are loading a jpeg or gif, be sure you have the corresponding
    ReportBuilder units in your "uses" clause... ppJPEG, or ppGif.

    2. You can load an image into a TppImage component by using the
    TppImage.Picture.LoadFromFile method. For instance...

    ppImage1.Picture.LoadFromFile('c:\myImage.bmp');

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited May 2004


    OK, but.. how can I protect if the file don't exist?

    Moro
  • edited May 2004
    Try using the FileExists method in the SysUtils unit.

    uses
    SysUtils
    ...

    lsFileName := 'c:\myImage.bmp';

    if FileExists(lsFileName) then
    ppImage.Picture.LoadFromFile(lsFileName);

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited May 2004


    I'm writing code in the calc tab of the project designer..
    it don't compile FileExists

    Moro
  • edited May 2004
    Hi Moro,

    For future reference, please post RAP questions in the RAP newsgroup. This
    helps us understand exactly which part of ReportBuilder you are using so we
    can answer your questions quicker and more accurately.

    You will need to create a RAP Passthru function that allows you to use the
    FileExists method. For an example of creating a passthru function for RAP,
    please see the ReportBuilder Developer's Guide located in the
    RBuilder\Developer's Guide\... directory.

    --
    Best Regards,

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