Link to home
Start Free TrialLog in
Avatar of Joar
Joar

asked on

How do I dynamically load images that have to be resized in a local report in Visual Studio 2005

My app is going to print documents for all may clients in one run. The print is created by a local report (rdlc) in the vb.net app (Visual Studio 2005).  The datasource is a procedure getting data from the db.
My problem: The clients have stored some images (that is a logo and a scanned signature) which I shall output on the printed documents. Different images for different clients. A path to the images does the job, BUT each image needs to be rezized to a fixed area on the document. And I cannot see any possibility to specify the resizing parameters to the images at run time. I am able to do report modifying before starting the report, by modifying the XML definition, but not at runtime. The modifcation parameters will be different for each clients document (page).
Any ideas?
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Why dont you resize the source images? If you are able to dynamically change the path of image file then you could load an original image, resize it and store it in temp file, then point to that temp file in the report.
Avatar of Joar
Joar

ASKER

It sounds reasonable... How do I resize an image on the fly. Is it some simple function in vb.net or...?
ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Forget about the call back. You dont need it with this function. You could use that callback with a simpler but not as good thumbnailing process. That process is to create a thumbnail size image of an existing image using the following

dim img as image = bimg.GetThumbnailImage(115, 86, cb, IntPtr.Zero)
Avatar of Joar

ASKER

Sorry, I have been busy and now I am leaving for the weekend.
Next I will look at your code and do some testing.
Thank you so far!