I have attached a document with one picture, that has been rotated by 90 degrees. I included a screenshot from Excel, that clearly shows that the width and the height of the image are both the same value. However, when you generate an image from the Shape.ToImage
method, the resulting image has different dimensions. I have included the image to show this. If you prefer, you can generate your own image using the following code, obviously after changing the file paths:
Workbook workbook = new Workbook(@"C:\Users\sheridan.yuen\Downloads\IncorrectSizeOfRotatedImage.xlsx");
Shape shape = workbook.Worksheets[0].Shapes[0];
Aspose.Cells.Drawing.Picture picture = (Aspose.Cells.Drawing.Picture)shape;
picture.ToImage(@"C:\Users\sheridan.yuen\Downloads\IncorrectSizeOfRotatedImage.png", new ImageOrPrintOptions() { ImageType = ImageType.Png });
Please note that your Picture
object shows the correct dimension values, so it’s just the output image size that is incorrect.
IncorrectSizeOfRotatedImage.zip (23.4 KB)