GM
Geetha M
Syncfusion Team
May 14, 2009 09:28 AM UTC
Hi Kelley,
Thank you for your interest in Syncfusion products.
Please try using the code snippet given below:
IWorksheet sheet = workbook.Worksheets[0];
Image img = Image.FromFile(@"..\..\logo.jpg");
sheet.Pictures.AddPicture(1, 1, img);
// '1' is the column index
sheet.SetColumnWidthInPixels(1, img.Width);
sheet.SetRowHeightInPixels(1, img.Height);
sheet.Pictures[0].IsMoveWithCell = true;
sheet.Pictures[0].IsSizeWithCell = true;
The above code will resize the image along with cell resize. This is equivalent to set the image properties in MS Excel by right clicking the image.
Please try this and let me know if you have any questions.
Regards,
Geetha