[英]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.