Hi Sylvain,

"Sylvain Caillet" <[EMAIL PROTECTED]> wrote on 12/01/2005 06:23:17 AM:

> I have a Java panel on which i have to allow my users to move a SVG 
object 
> rendered with the Batik API. I'm looking for a way to use the XOR 
technic to 
> efficiently paint/remove my object during the move.

   You can't really use XOR for SVG content since it uses alpha 
compositing.
I would suggest rendering the SVG content to a BufferedImage with alpha 
and
then just move the buffered image version.  This will be plenty fast...
and look a lot better ;).

> 
> I currently a code like that to paint the SVG :
> ---------------- begin code --------------
> public void paint(Graphics g) {
> // GraphicsNode gn;
>  Graphics2D g2d;
> 
>  g2d = (Graphics2D)g.create(x,y,width,height);
>  g2d.scale(sx, sy);
>  gn.paint(g2d);
> }
> ---------------- end code --------------
> Is it possible to use (on g or g2d ?) the setXORMode method ?
> 
> Thank you for your help
> 
> Best regards
> 
> Sylvain Caillet
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to