Hello aspose team,
We are going to insert the png image into the excel. When I try to insert the image with some height and width (whose aspect ratio is fine) into excel by changing its height and width using setHeight() and
setWidth() then the aspect ratio of image is not preserved.
Code snippet is:-
(for example :- I have an image with size 600*400 in dimension (whose aspect ratio is fine) when I try to insert the image using following code snippet the aspect ratio gets distorted)
int pictureIndex = ws.getPictures().add(0, 0, “600/400image.png”)
Picture picture = ws.getPictures().get(pictureIndex)
Is there any way to preserve the aspect ratio irrespective with its size in excel.