It looks like a bug in PPGraphics2D: draw commands (draw(), drawRect, etc.) don't set the line color and always have the default line color which is black. I committed the fix in r1344204. Can you please try with the latest build from trunk?
Yegor On Wed, May 30, 2012 at 12:26 PM, Charles.Yang <[email protected]> wrote: > Hi all, > I am a new person in use of POI. I'm trying to draw some shapes on a slide. > When I drawn line or rectangle with specified color, the color did not work. > But the method Graphics2D.fillRect() worked well. > The below is my code: > Slide s2 = ppt.createSlide(); > ShapeGroup group = new ShapeGroup(); > group.setAnchor(new Rectangle(100, 100, 300, 300)); > s2.addShape(group); > > Graphics2D g = new PPGraphics2D(group); > g.setColor(Color.red); > g.drawString("Color not work from shape", 100, 100); > g.setColor(Color.blue); > g.drawLine(100, 100, 200, 200); > g.setColor(Color.green); > g.drawRect(100, 220, 100, 100); > g.fillRect(220, 220, 100, 100); > > Is there any problem with my code? or the API cannot support this. > Any answer will be appreciated. > Thanks > > > > -- > View this message in context: > http://apache-poi.1045710.n5.nabble.com/Using-Graphics2D-to-draw-line-on-a-Slide-the-color-setting-is-not-work-tp5709997.html > Sent from the POI - User mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
