Hi,
I am coding a pdf report and I cannot figure out how to add an image to it. Adding text works all fine but this does not compile:
Infragistics.Documents.Reports.Graphics.Image myPicture = section.AddImage(new Infragistics.Documents.Reports.Graphics.Image("MyImage.jpg"));Error CS0266 Cannot implicitly convert type 'Infragistics.Documents.Reports.Report.IImage' to 'Infragistics.Documents.Reports.Graphics.Image'. An explicit conversion exists (are you missing a cast?)
How can I get this to work?
TIA
Erik
Hi Erik,Thank you for contacting Infragistics Developer Support.This error happens, because the AddImage doesn’t return Infragistics.Documents.Reports.Graphics.Image report, but actually an Infragistics.Documents.Reports.Report.IImage object. So naturally the application can’t compile, because you have defined the myPicture object as Infragistics.Documents.Reports.Graphics.Image. Simply change its time to IImage and the application will compile.I have attached a small sample which demonstrates how to add an image to a PDF file. Let me know if you have any additional questions.
Hi Dimitar,
Thanks very much, this is extremely helpfull!