Hi Sébastien.

Hamel, Sébastien:
> The simplified code used to convert from SVG to the BufferedImage is the 
> following 
> 
>       public BufferedImage getImage(SVGDocument svgDocument, int width, int 
> height) {
>             // Paint svg into image buffer
>             //BufferedImage bufferedImage = new BufferedImage(width, height,
>                   //    BufferedImage.TYPE_USHORT_565_RGB);
>             BufferedImage bufferedImage = new BufferedImage(width, height,
>                         BufferedImage.TYPE_3BYTE_BGR);
>             Graphics2D g2d = (Graphics2D) bufferedImage.getGraphics();
>  
>             // For a smooth graphic with no jagged edges or rastorized look.
>             
>             
>             g2d.setBackground(Color.WHITE);

I’m wondering whether it is an issue of what the BufferedImage is filled
with when you first create it.  Since you use TYPE_3BYTE_BGR, there is
no alpha channel, so the BufferedImage will be filled with some solid
colour.

How about doing a fillRect() to fill the BufferdImage with white
explicitly (assuming that’s what you want as your background colour)?

  g2d.setColor(Color.WHITE);
  g2d.fillRect(0, 0, width, height);

-- 
Cameron McCormack ≝ http://mcc.id.au/

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to