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. Image for the cookie policy date
close icon

Center Images

How do you center images?

code:


//this inserts the image
excel.InsertImage(imageFileName, 1, 1);

//Range
IRange logoRange = excel.GetRange("A1", "E1");
logoRange.Merge();

//Trying to center the image but this does not work
logoRange.HorizontalAlignment = ExcelHAlign.HAlignCenter;

The Images appears in cell 1
I want it in the center of the merged cells.

Any ideas?

Thanks






1 Reply

GM Geetha M Syncfusion Team June 3, 2009 12:19 PM UTC

Hi,

Thank you for your interest in Syncfusion products.

It is not possible to center an image using IRange.HorizontalAlignment. Only text content can be aligned. Also it is not possible to center the image in MS Excel.

Please let me know if you have any questions.

Regards,
Geetha

Loader.
Live Chat Icon For mobile
Up arrow icon