You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Ken Arnold <ar...@moonhill.org> on 2009/12/18 18:32:38 UTC

XSSFColor to RGB failures

I have been trying to figure out how to translate the XSSF colors I have into RGB values so I can, like, display them properly.  XSSFColor.getRgb() returns null.

I'm working on a spreadsheet that was original an Excel '97 .xls file with indexed and custom colors.  I can get the colors correctly from HSSFColor when I read the .xls file.  I saved it as a .xlsx file.  In XSSF, when I pick up an indexed color (background fill, if it matters), I get the null from getRgb().  I can't find the equivalent of HSSFWorkbook.getCustomPalette() to get a place to look them up.  I've stepped into the XSSFColor code and watched it not find the rgb values.  Where are they supposed to be coming from?  Or is there some config problem that's causing this?

I'm working off a trunk from four weeks ago, since I wanted to contribute back what I'm building.  I suppose I should try this against the current release in case it is a recent bug, but I'm hoping it's just a relatively stupid mistake of mine.

I would appreciate any guidance or hints.

		Ken
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


HSLF setting background fill not working

Posted by Gordon Belray <go...@utoronto.ca>.
Hi,

the code below works with POI version 3.0.2 but in 3.6 I get a red x  
for the background:

     	Fill fill = master.getBackground().getFill();
         int idx1 = ppt.addPicture(new File("/Users/gordon/ 
background.png"), Picture.PNG);
         fill.setFillType(Fill.FILL_PICTURE);
         fill.setPictureData(idx1);

I can pass in jpegs and create other pictures without a problem.

Any ideas for a solution would be appreciated.

Thanks,
Gordon

Gordon Belray
Information Architect and Imaging System Manager
Information Technology Services Robarts Library
416.946.8617    cell: 416.427.7007
gordon.belray@utoronto.ca