【问题标题】:Powerpoint slide background color does not set properlyPowerpoint 幻灯片背景颜色设置不正确
【发布时间】:2015-09-17 16:13:41
【问题描述】:

我使用以下代码将幻灯片添加到演示文稿中,然后我想将其背景颜色设置为演示文稿中已存在的其中一张幻灯片的颜色:

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(在我设置颜色的行之前和之后)。如何解决这个问题?

【问题讨论】:

    标签: c# powerpoint-2013


    【解决方案1】:

    这解决了问题:

     int slide_color = presentation.Slides[e].Background.Fill.ForeColor.RGB;
     presentation.Slides[presentation.Slides.Count].Design.SlideMaster.Background.Fill.ForeColor.RGB = slide_color;
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-11-17
      • 2013-01-08
      • 2014-01-12
      • 2023-03-25
      • 2011-03-26
      相关资源
      最近更新 更多