Hi,
I'm trying to add an image to an Excel spreadsheet.
The problem is that the image is stretched through all the rows in the Spreadsheet.
Only the rows not the columns.
This is the code that I use and also some comments:
BitmapShapeImpl bitmap = workSheet.Pictures.AddPicture(1, 1, imageStream, 100, 100, ExcelImageFormat.Png) as BitmapShapeImpl;
bitmap.Width = bitmap.Picture.Width; // the width is correct
bitmap.Height = bitmap.Picture.Height; // the height is correct
int rowImage = bitmap.BottomRow; // this is a really high number = 1048576
int columnImage = bitmap.RightColumn; // this is correct = 2
If I open the created Spreadsheet in Excel and check the properties for the image, I get the following:
- Height is 0
- Width is a correct Number
- Adapt Height (a percentage): This is a really high number 3 089 545%
- Adapt Width (a percentage): This is a correct number
This code used to work!
I have done some updates during the last month; for example to the XlsIO component (latest version) and to Xamarin Forms (latest stable version).
Today I noticed that this part of the code did no longer work...I have tried different solutions but nothing seems to help.
Attachment:
ExcelExample_df3d9d00.zip