We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Examples of inserting images into an Excel sheet

Thread ID:

Created:

Updated:

Platform:

Replies:

124589 Jun 15,2016 09:06 PM UTC Jun 16,2016 06:16 AM UTC ASP.NET Web Forms 1
loading
Tags: XlsIO
Todd J
Asked On June 15, 2016 09:06 PM UTC

Can anyone provide some samples of inserting images into row/cell when the image is coming from some external web location?
Thanks!

Dilli Babu Nandha Gopal [Syncfusion]
Replied On June 16, 2016 06:16 AM UTC

Hi Todd, 

Thank you for contacting Syncfusion support. 

Yes, you can able to insert an image from a Web location in a worksheet using XlsIO. The following code example illustrates this behavior. 

Code Example: 
 
IWorksheet worksheet = workbook.Worksheets[0]; 
 
string imgLoc= @"https://cdn.syncfusion.com/content/images/company-logos/Syncfusion_Logo_Image.png"; 
 
//Retrieving from Web 
WebClient webClient = new WebClient(); 
byte[] imageBytes = webClient.DownloadData(imgLoc); 
MemoryStream stream = new MemoryStream(imageBytes); 
 
//Adding a picture 
IPictureShape shape = worksheet.Pictures.AddPicture(1, 1,stream); 
 

We have shared a sample for your reference which can be downloaded from the following link. 


Please let us know whether the sample fulfills your requirement. 

Regards, 
Dilli babu. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;