Hi Aspose Team,
I’ve faced an issue when I cannot keep the initial size of an added picture into an excel document.
Even if the following properties is set to true:
image.png (13.7 KB)
As an example, I’m using this piece of code:
Aspose.Cells.Workbook workbook = new Aspose.Cells.Workbook();
Aspose.Cells.WorksheetCollection worksheets = workbook.Worksheets;
Aspose.Cells.Worksheet worksheet = worksheets.Add("My Worksheet");
worksheet.Pictures.Add(0, 0, "sample_640×426.jpeg");
Aspose.Cells.Cell cell = worksheet.Cells[0, 10];
cell.Value = "Any text";
workbook.Save("newWorksheet.xls");
workbook = new Aspose.Cells.Workbook();
worksheets = workbook.Worksheets;
worksheet = worksheets.Add("My Worksheet");
worksheet.Pictures.Add(0, 0, "sample_640×426.jpeg");
cell = worksheet.Cells[0, 10];
//<-- Part that brakes height and height scale
Aspose.Cells.Style cellStyle = cell.GetStyle();
cellStyle.Font.Size = 20;
cell.SetStyle(cellStyle);
//-->
cell.Value = "Any text";
workbook.Save("newWorksheetBrokenHeight.xls");
It creates two different documents with different heights of one picture.
Is it intended behavior or not?
Do we have any solutions to keep the initial image size?
Thanks in advance!
Source img here: sample_640×426.jpeg (86.7 KB)