POI 中Cell的backgroundcolor和foregroundcolor

刚开始以为要获得cell的背景色是使用  getFillBackgroundColor()这个函数(这里返回的是调色板的索引,要获得RGB需要先获得系统的Pallete,然后在获得 RGB)。结果出来的索引都是一样的,搜索了好一会,发现都没有自己要的答案,想想自己估计又犯了什么低级错误了,这个问题应该不是什么问题。果然在 POI的文档里面,这个问题就已经陈述出来了:

public short getFillBackgroundColor()

Get the background fill color. Note - many cells are actually filled with a foreground fill, not a background fill - see getFillForegroundColor()

public short getFillForegroundColor()

Get the foreground fill color. Many cells are filled with this, instead of a background color (getFillBackgroundColor())


这里写到许多cell其实是使用前景来填充的,而不是背景填充,所以应该要用getFillForegroundColor这个函数。当然目前还不是很了解background fill 和foreground fill。


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值