Hi, I was wondering if anyone can help, I have a silverlight application and have integrated the Spire.XLS, all good, I have laid out my sheet and all is OK. Now i want to incorporate an image or 2 into the worksheets. The images I want to put in are both available at a URL and also embedded in the root of the silverlight application. How can I incorporate these, when I try to set the file path to http://www.xyz.com/abc/abc/image1.png I get a
{System.ArgumentException: URI formats are not supported.
at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at System.Drawing.Image.FromFile(String fileName)
at Spire.Xls.Core.Spreadsheet.Collections.XlsPicturesCollection.Add(Int32 topRow, Int32 leftColumn, Int32 bottomRow, Int32 rightColumn, String fileName, ImageFormatType imageFormat)
at Spire.Xls.Collections.PicturesCollection.Add(Int32 topRow, Int32 leftColumn, Int32 bottomRow, Int32 rightColumn, String fileName, ImageFormatType imageFormat)
at ChicaneInvoicing.MainPage.saveinvoice_Click(Object sender, RoutedEventArgs e)}
and when i set it to @"..\image1.png" or "image1.png" I get a
{System.Security.SecurityException: File operation not permitted. Access to path 'gtrak.png' is denied.
at System.IO.FileSecurityState.EnsureState()
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at System.Drawing.Image.FromFile(String fileName)
at Spire.Xls.Core.Spreadsheet.Collections.XlsPicturesCollection.Add(Int32 topRow, Int32 leftColumn, Int32 bottomRow, Int32 rightColumn, String fileName, ImageFormatType imageFormat)
at Spire.Xls.Collections.PicturesCollection.Add(Int32 topRow, Int32 leftColumn, Int32 bottomRow, Int32 rightColumn, String fileName, ImageFormatType imageFormat)
at ChicaneInvoicing.MainPage.saveinvoice_Click(Object sender, RoutedEventArgs e)}
I am wondering if this can be done at all from silverlight, using a stream? saving to isolated storage and re-loading from there? anything. Any help would be appreciated and any code samples would be massively appreciated!
Cheers, Tom