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.
Unfortunately, activation email could not send to your email. Please try again.

AddPicture oversizes the image

Thread ID:

Created:

Updated:

Platform:

Replies:

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

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





map_8b3ede2a.zip

Dave R
Replied On June 23, 2010 07:24 PM

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



MapPng_c2b0cb56.zip

Sathish Babu R [Syncfusion]
Replied On June 24, 2010 09:32 AM

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.

Regards,
Sathish

CONFIRMATION

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.

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.

;