We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

AddPicture oversizes the image

Thread ID:





95174 Jun 23,2010 11:07 PM UTC Jun 24,2010 01:32 PM UTC ASP.NET Web Forms (Classic) 2
Tags: XlsIO
Dave R
Asked On June 23, 2010 11:07 PM UTC

When I add an image to a worksheet using XlsIO (worksheet.Pictures.AddPicture(1,1,"map.png", ExcelImageFormat.Png) the image size is not preserved.

The png image that I have is 1862x4575 pixels at 300dpi. This should be 6.21x15.25 inches. Inserting with Excel does it correctly.

I've attached a spreadsheet with the image as manually inserted via Excel on one tab (correctly sized) and another tab showing the results of XlsIo inserting the image (waaaaaay oversized).

What is the reason for this? What is the workaround?

Thanks much,

Dave R


Dave R
Replied On June 23, 2010 11:24 PM UTC

Also, I tried using the 'scale' parameters which do allow me to reduce the size of the image:

Sheet.Pictures.AddPicture(1, 1, mapImage, 33, 33, ExcelImageFormat.Png);

Unfortunately, this also reduces the quality of the image.

Because the image that I am showing is generated by another process, I don't know in advance the size or shape of the image. All I know is that it will (or should) fit on 11x17 paper with room for a limited amount of text. I just need to be able to place the image at r1 c1 and have it display to its correct size.

Attached is the actual image...


Sathish Babu R [Syncfusion]
Replied On June 24, 2010 01:32 PM UTC

Hi Dave,

Thank you for your interest in Syncfusion products.

We were able to reproduce the issue at our side and the issue mentioned here is suspected to be defect. Could you please report this issue through Direct Trac Developer Support System?
https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents so that we can provide you with the patch for this issue as well as you can take the advantage of the expertise of a dedicated support engineer and a guaranteed response time and we hope you will take advantage of this system as well.

Please let me know if you have any queries.



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon