We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Added images are not scaled

Hello,
I add a png image to a worksheet, but when I open the excel document, the image is not scaled to 100%.
byte[] imgBytes = File.ReadAllBytes(“C:\temp\pic.png”);
MemoryStream ms = new MemoryStream();
ms.Write(imgBytes, 0, imgBytes.Length);
ws.Pictures.Add(7, 0, ms);
image.png (797.1 KB)

Do I need to call some other API?
Thank you.

@mpogorelov
Please upload your image file here, we will check it soon.
And could you share language setting, OS info ?
The default font is different in different region since Excle 2007, the column’s width is different too.

I use Windows 10, English USSS Kits Accessories_[2 Centralized System - 1 % System 2] Design.png (91.4 KB)

@mpogorelov,

Could you please try our latest vesion/fix: Aspose.Cells for .NET v21.12 (Downloads section/Nuget repos.). I have tested using your sample code and picture with latest version and it works fine. The inserted image’s scale is fine (height and width are 100%) when checking in MS Excel for the output Excel file.

Let us know if you still find any issue with latest version/fix.