Free Support Forum - aspose.com

Table cell background color

I am trying to set the back color of a cell in a table on my ppt slide. I have the cell set to white with a single space in the cell on the template I clone from. Whatever color is set on the template will keep on all generated slides. If I try to set a back color of a cell it does nothing.
I need to be able to set the back color of a cell.
Here is the code I am using.


table.GetCell(0, 0).FillFormat.BackColor = Color.Red


Any Ideas?
Ray

Dear Ray,

Did you try to set fill type?

table.GetCell(0,0).FillFormat.Type = FillType.Solid;
table.GetCell(0,0).FillFormat.BackColor = Color.Red;

Also please check
http://www.aspose.com/Products/Aspose.PowerPoint/Guide/FillFormat.html

Thanks for the link. It would seem that the properties are mislabeled. The backcolor property does not set the background color of the cell. Setting the forecolor property does.
Filltype apperently need not be set.

Dear Ray,

Please don’t mix “background” and “background color”.
Also Background and FillFormat are different things.

ForeColor property is a main color for all filling styles.
BackColor used for gradients and patterns only because they can be transparent.

Alexey:

Help me on this one.


table.GetCell(0, 0).FillFormat.Type = FillType.Solid
table.GetCell(0, 0).FillFormat.ForeColor = Color.Red
table.GetCell(0, 1).FillFormat.Type = FillType.Solid
table.GetCell(0, 1).FillFormat.ForeColor = Color.FromArgb("&H0033CC33")

The red cell is shown perfectly fine fills the entire cell without problem. The fromargb color only shows when I click on the cell and when it does there is a white border around the colored square in the center. There is a single space in each cell I am attempting to fill.
attached is the generated ppt file showing this.

Dear Ray,

I don’t know about FromArgb("&H0033CC33") but FromArgb(0, 0x33, 0xCC, 0x33) is a 100% transparent color.