【问题标题】:How can I assign a custom color to a cell in Aspose Cells?如何为 Aspose Cells 中的单元格分配自定义颜色?
【发布时间】:2017-01-30 18:52:29
【问题描述】:

在旧版(Excel 互操作)代码中,可以为单元格分配自定义颜色:

contractCell.Interior.Color = ColorTranslator.ToOle(Color.FromArgb(202, 134, 250));

使用 Aspose Cells,我试图找到相应的方法来做到这一点。这段代码:

styleContractRow2.ForegroundColor = ColorTranslator.ToOle(Color.FromArgb(202, 134, 250));
styleContractRow2.Pattern = BackgroundType.Solid;

...不编译,告诉我,“无法将类型 'int' 隐式转换为 'System.Drawing.Color'

那么如何在 Aspose Cells 中分配自定义颜色?

【问题讨论】:

    标签: excel-interop aspose aspose-cells argb colortransform


    【解决方案1】:

    请查看your Aspose.Cells forum thread中的回复和示例代码。

    注意:我在 Aspose 担任开发人员宣传员

    【讨论】:

      【解决方案2】:

      似乎不需要翻译;编译:

      styleContractRow2.ForegroundColor = Color.FromArgb(202, 134, 250);
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-02-22
        • 1970-01-01
        • 1970-01-01
        • 2018-03-21
        • 1970-01-01
        • 2012-07-10
        相关资源
        最近更新 更多