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

Stretch image only if it exceeds width or height of TppDBImage

edited April 2009 in RAP

Hi,

On my report (ReportBuilder 10.09) I've added an TppDBImage.
The size of this component is set to 187 * 173 (W * H).
Stretch = True.
MaintainAspectRatio = True
This works fine when the loaded image is bigger than the TppDBImage.
But when a smaller image is loaded, the quality of the image will be worse,
because it's stretched.

Is there a way to only stretch the image when either Width or Height is greater
than TppDBImage.

Regards,
Stef

Comments

  • edited April 2009

    Try setting Stretch to False. Set AutoSize to True.

    Stretch in this context really means - resize the image to fit within the
    bounds of the control. So the image gets either shrunk or enlarged.

    AutoSize means resize the Bounds of the control to reflect the size of the
    image.


    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited April 2009

    If you want to limit the size of the Image control, try using the
    DetailBand.BeforePrint event to check the image dimensions.

    Example:

    If myImage.Picture.Width > MaxWidth then
    myImage.Stretch := True
    else
    myImage.Stetch := False;



    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited April 2009
    Hello Nard,

    Thank you for the fast feedback.
This discussion has been closed.