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

Hi,

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 4.4.0.2 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 :)

Hi,

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 ...

Hi,

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 4.5.0.0

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 4.4.3.1

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

Hi,

Thanks for providing us details.

We will check your issue soon.

Thank you.

Hi,

Thanks for your info.

We have fixed this bug.

Please try this fix.

The fix works great.

Thanks very much !