Hi,
I'm using Telerik Reporting 9.015.324 (VS 2015, Windows 10 x64). I have a PictureBox in the Detail section of my report. I have its Value property set to a string field in my data source - "ImagePath" - which is returning file paths. The images are different sizes and proportions and I need them all to fit within the margins of the report. Additionally, there is a TextBox in the Detail section with text content returned by the data source - "Content". I'm trying to use a User Function to enforce a maximum Height and/or Width on the PictureBox based on the actual Height/Width of the image file.
This is my height function:
public
static
int
GetPictureBoxHeightFromImagePath(
string
imagePath)
{
Image img = Image.FromFile(imagePath);
return
img.Height;
}
That user function is bound to the Height property of the PictureBox.
When I preview my report I get an "Out of memory" exception almost immediately.
I'm curious as to why I'm getting this exception, but my main objective is to get my report images to fit within the report.
I'm open to other approaches.
Thanks much.