[prev in list] [next in list] [prev in thread] [next in thread] 

List:       batik-users
Subject:    Color changes when rendering to PNG
From:       "Philip Arad" <philip_arad () hotmail ! com>
Date:       2002-01-17 19:09:51
[Download RAW message or body]

Hi

I use this method for rendering the SVG file
to PNG:

The program:
public class SaveAsPNG
{
    public static void main(String [] args) throws Exception
    {

        // create a PNG transcoder
        PNGTranscoder t = new PNGTranscoder();
        //t.addTranscodingHint(PNGTranscoder.KEY_FORCE_TRANSPARENT_WHITE,new 
Boolean(true));
        // set the transcoding hints
        // create the transcoder input
        String svgURI = new File(args[0]).toURL().toString();
        TranscoderInput input = new TranscoderInput(svgURI);
        // create the transcoder output
        OutputStream ostream = new FileOutputStream(args[1]);
        TranscoderOutput output = new TranscoderOutput(ostream);
        // save the image
        t.transcode(input, output);
        // flush and close the stream then exit
        ostream.flush();
        ostream.close();
        System.exit(0);
    }
}

The SVG (only a part):
  <g id="TagBody" style="fill:#CCCCCC">
    <rect x="0" y="10" width="100" height="25"/>
  </g>

I recieve a PNG image with the color:#C6C6C6

Is anyone have notice it?
What has to be done to recieve the right color?

Philip




_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic