繁体   English   中英

如何为“ Aspose Cells”中的单元格分配自定义颜色?

[英]How can I assign a custom color to a cell in Aspose Cells?

在旧版(Excel Interop)代码中,可以这样做来为单元格分配自定义颜色:

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中分配自定义颜色?

请在Aspose.Cells论坛主题中检查答复和示例代码。

注意: 我在Aspose担任开发人员布道者

好像翻译是不必要的; 编译:

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM