Bug 47675 - Wrong shadow color for Shape
Summary: Wrong shadow color for Shape
Status: RESOLVED INVALID
Alias: None
Product: POI
Classification: Unclassified
Component: HSLF (show other bugs)
Version: 3.5-dev
Hardware: PC Windows XP
: P2 major (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-11 08:51 UTC by Jie Han
Modified: 2009-09-07 09:56 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jie Han 2009-08-11 08:51:32 UTC
I use "shape.getEscherProperty(EscherProperties.SHADOWSTYLE__COLOR)" to get the shadow color but the result seems wrong.

//////////////////////////////////////
v = shape.getEscherProperty(EscherProperties.SHADOWSTYLE__COLOR)";
Color color = new Color(v);
//////////////////////////////////////

and then print out the rgb value.
Comment 1 Yegor Kozlov 2009-09-07 09:56:11 UTC
Creating AWT Color from Escher properties is a bit more complicated. The correct code is below.

int val = shape.getEscherProperty(EscherProperties.SHADOWSTYLE__COLOR)";
int opc = shape.getEscherProperty(EscherProperties.SHADOWSTYLE__OPACITY)";
int alpha =  opc == 0 ? 255 : ((opc >> 8) & 0xFF);

Color color = shape.getColor(rgb, alpha);

Yegor