Good Day,
I am using SpreadSheetLight library(https://spreadsheetlight.com/) to create new excel files. In one of the cells, I am inserting image from file. I want to enable picture property "Move and size with cells" but can't find any way to do it. What's happening because of this is that while the picture looks ok in the excel file, when printing, the picture is getting shrunk. Really hoping someone could help in this regard.
Below is sample code of inserting the picture. 
byte[] imgdata = File.ReadAllBytes(sTempSnapName);
SLPicture pic = new SLPicture(imgdata, ImagePartType.Png);
//The pic size in inches
pic.ResizeInEMU((long) SLConvert.FromInchToEmu( 3.51), (long)SLConvert.FromInchToEmu(2.71));
pic.SetPosition(27, 0);
//How to Set "Move and size with cells" option?
oMainReportXlsx.InsertPicture(pic);
Thanks, Kev
What you are looking for is called Picture.Placement where you can set predefined XlPlacement value.
However, this functionality is not supported in the .NET library Spreadsheet Light directly (I've checked the source code, there is no mention of
Placementas of now - 30.05.2023). If you want achieve such behavior, you must use other .NET library (e.g. Microsoft.Office.Interop.Excel ):