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