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); |
Images can’t be inserted into cells, but actually they are present in separate layer and keep floating over the cells. Well you can resize image to get into a specific cell by stretching or squeezing the corners of your image but this results in an untidy looking spreadsheet.
As the image won’t appears to set in a specific cell. I have done this task of inserting gif image into Excel using VBA code and got perfect result.
If you also want to try then take help from this post: How To Insert Animated GIF Images In Excel 2007/2010/2013/2016
Any way I can inject multiple images, please note these are embedded and not web images into a sheet in specific locations, I am looking for something like this more or less?
Would it be a good direction to use a grid and export to excel in the grid?