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

Free Support Forum - aspose.com

Scaled Image gets distorted when using "Large Fonts" 120DPI in windows

I have difficulties inserting a scaled image when I am using Large Fonts (120DPI). With 96 DPI, the image gets inserted correctly and the aspect ratio is ok.

But when I insert the image while using a 120DPI fonts, I get the wrong aspect ratio and the image is not exactly located where I want it to be. For example if I scale both width and height to 40% the result is 40% for the height and 35% for the width.

You can only reproduce the problem if you reboot, after you changed the font resolution to 120DPI


Could you explain the issue by posting your template image with your sample code here.

Which version of Aspose.Cells for .Net or java you are using? Did you try the latest 4.4?

Thank you.

I am using for .NET (The fix that was just posted)

I will prepare sample code, but the problem should occur with every image.

Hi again,

Here is some sample code. It is not as simple as I had thought. The problem only occurs, if the workbook is saved and reopened several times. I hope you can find the problem from my sample code.

I have a workaround, because if I do not save and reopen the workbook after every sheet I insert, then the problem does not occur.

But still maybe you can find out what the problem is with my attached code sample.

Thanks :)


Well, I run your project and the output excel file is ok with image placed fine in each worksheet (1-15). For your info, after you call the Save method of the Workbook object, all the references, objects, data related to it will be null. So you may instantiate the workbook object after the Save method and before opening the excel file using Workbook.Open method. By the way, I run the solution several times but still could not produce the problem.

Any how we will further check if we could find the problem.

Thank you.

Did you test with 120DPI fonts after a reboot ? very strange that it does only occur on my machine. I attached the result that I get.

Actually on my machine, the aspect ratio is different on each of the sheets. It is especially distorted on sheet 1 and gets better for the higher sheet numbers ...


And Attached is my result (output file using your project with image file).

We will further investigate if we can figure it out.

Thank you.

Hi Armin ,

Pease try this fix.

Now it works great.

Thanks very much !

The problem has returned in

Can you please fix it ? All my images get distorted again. Maybe it is not the same problem, but still ... the images are not correctly scaled with 120 dpi screen fonts.

It still worked with

Maybe you can better identify the problem by doing a comparison to that version.


Thanks for providing us details.

We will check your issue soon.

Thank you.


Thanks for your info.

We have fixed this bug.

Please try this fix.

The fix works great.

Thanks very much !