Powerpoint 幻灯片背景颜色设置不正确
Powerpoint slide background color does not set properly
我使用以下代码向演示文稿中添加一张幻灯片,然后我想将其背景颜色设置为演示文稿中已存在的其中一张幻灯片的颜色:
presentation.Slides.AddSlide(presentation.Slides.Count + 1 presentation.Slides[presentation.Slides.Count].CustomLayout);
//set the last slide color to the color of the current slide
presentation.Slides[presentation.Slides.Count].Background.Fill.ForeColor.RGB = presentation.Slides[e].Background.Fill.ForeColor.RGB;
presentation.Save();
但是,颜色没有设置为红色。右侧的值为 255,这是我想要的值,但左侧的值为 11675(在我设置颜色的行前后)。如何解决这个问题?
这解决了问题:
int slide_color = presentation.Slides[e].Background.Fill.ForeColor.RGB;
presentation.Slides[presentation.Slides.Count].Design.SlideMaster.Background.Fill.ForeColor.RGB = slide_color;
我使用以下代码向演示文稿中添加一张幻灯片,然后我想将其背景颜色设置为演示文稿中已存在的其中一张幻灯片的颜色:
presentation.Slides.AddSlide(presentation.Slides.Count + 1 presentation.Slides[presentation.Slides.Count].CustomLayout);
//set the last slide color to the color of the current slide
presentation.Slides[presentation.Slides.Count].Background.Fill.ForeColor.RGB = presentation.Slides[e].Background.Fill.ForeColor.RGB;
presentation.Save();
但是,颜色没有设置为红色。右侧的值为 255,这是我想要的值,但左侧的值为 11675(在我设置颜色的行前后)。如何解决这个问题?
这解决了问题:
int slide_color = presentation.Slides[e].Background.Fill.ForeColor.RGB;
presentation.Slides[presentation.Slides.Count].Design.SlideMaster.Background.Fill.ForeColor.RGB = slide_color;