Free Support Forum - aspose.com

Image distorted on Windows 2000 Server

Hello,
I am generating an Excel document containg PNG images on my development box(WinXP Service Pack1) and test box Windows 2000 Server Service Pack 4). There seems to be some problem with image that is inserted on Windows 2000 server box).

I am running .NET framework version v1.1.4322 on both box. I am inserting .PNG image of 200 x 125 pixels dimesion into the Excel document. Here is the code to insert the image

int iPicId = xlActWorkSheet.Pictures.Add(iXlCurrRowNum,iColNo,sImageFileName,100,100);

Picture xlPicture = xlActWorkSheet.Pictures[iPicId];
xlPicture.Left = 0;
xlPicture.Top = 0;
xlPicture.Placement = PlacementType.MoveAndSize;

When I open the Excel document generated on WinXP box, the image seems to fine and maintians its original size(200 x 125 pixels). But If I open the document generated on Windows 2000 server the image is distorted and shrinks to 1.0" x 0.63", but the image I inserted on both machine is of same dimension of 200 x 125px(2.03" x 1.3"). I am wondering why the image is getting resized/distorted when I generate on Windows 2000 server box?

I am attaching screen shots showing difference in the image size. The same code is used to generate to Excel on both. I PNG image is identical on both box.

Thanks,
Raj

WinXP image size

Could you please zip the following files and post them here?

1. The image file
2. Excel file created on Win2000
3. Excel file created on WinXP

Thank you.

By the way, which version of Aspose.Excel.dll are you using? Could you please try this attached dll?

Hi Laurence,
I am attaching the files that you have requested. I am using 3.2.2.0 version of Aspoe.Excel.dll. There is a small difference in the size of PNG images, where as the dimension of them is same on both XP and Win2k server(200 x 125px).

If you need more info, let me know.
Thanks,
Raj

Hi Raj,

I think that’s related to the property of your image files. I manually insert images into an Excel file using MS Excel. Your win2k images always are smaller than winxp images. Please try it.