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

How to set background image for a table cell

Platform: WinForms |
Control: Presentation

Essential  .NET PowerPoint library does not provide direct support for adding background images for table cells.  You can add a background image for a table cell by choosing the “FillType” as “Picture” for the cell’s background.

 

Please find the code example for this as below.

 

//Create an instance of PowerPoint Presentation 
IPresentation presentation = Presentation.Create();
//Add a blank slide to the presentation.
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
//Add a table with 4 rows and 4 columns with specified size.
ITable table = slide.Tables.AddTable(4, 4, 50, 50, 500, 400);
//Get an image instance from file.
Syncfusion.Drawing.Image image = Syncfusion.Drawing.Image.FromFile("BackgroundImage.png");
//Get the instance of first cell from first row.
ICell cell = table.Rows[0].Cells[0] as ICell;
//Set fill type as Picture.
cell.Fill.FillType = FillType.Picture;
//Set image for picture fill image.
cell.Fill.PictureFill.ImageBytes = image.ImageData;
//Save presentation with specified file name.
presentation.Save("Table.pptx");
//Start the presentation
Process.Start("Table.pptx");

 

 

You can find the complete sample here.

 

Conclusion

I hope you enjoyed learning about how to set background image for a table cell.

You can refer to our .NET PowerPoint library’s feature tour page to know about its other groundbreaking feature representations.

For current customers, you can check out our File Formats from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our .NET PowerPoint and other File Formats framework.

If you have any queries or require clarifications, please let us know in comments below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

 

 

 

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

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

Up arrow icon

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