I am trying to place image inside table cell in ppt , but image is auto fitting to cell width , i want my image at center of cell

     Syncfusion.Drawing.Image StrategyVisionimage = GetHarveyBallImage(Math.Round(decimal.Truncate(longListViewModels[i].StrategyVision), 0));

 ICell cell = LongListTable.Rows[i].Cells[1] as ICell;

  cell.Fill.FillType = FillType.Automatic;

 cell.Fill.PictureFill.ImageBytes = StrategyVisionimage.ImageData;

This what i getting 




I want like this 



1 Reply

AN Anto Nihil Sahaya Raj Syncfusion Team September 29, 2022 09:40 PM UTC

Hi Kiran,

From the given details, we have found that you have
added a background image for a table cell. so that image preserved like image is auto fitting to cell width. While adding a background image for a table cell in Microsoft PowerPoint application, it preserves also like same. But we have adjusted the image to placed at center of the cell by setting off set values in Microsoft PowerPoint application Please refer the below screenshot.


At present, Essential Presentation doesn’t have any public offset API to place the image at center of the cell.

In Microsoft PowerPoint application, it is not feasible to directly add the picture into the cell. It can be achieved by adding the picture and then set the position of the picture where you want to preserve.

As a workaround to place the image at center of the cell, we suggest you to get the center position of the particular cell and place the image at that center position.

We have prepared the sample application to get the center position of the particular cell and place the image at that center position and it can be downloaded from the below attachment.

The sample can be downloaded from the below link.

https://www.syncfusion.com/downloads/support/directtrac/general/ze/ConsoleApp1-1156050354.zip

In this sample we have done the followings.
1. Create the presentation document.
2. Insert the one slide and one table on this.
3. Get the X and Y position of the cell.
4. Insert the Image at center of the cell.
5. Save the presentation document.


Regards,
Anto Nihil S

If this post is helpful, please consider Accepting it as the solution so that other members can locate it more quickly.


Loader.
Up arrow icon