Package org.apache.batik.transcoder

Examples of org.apache.batik.transcoder.TranscoderInput


        JPEGTranscoder jpegTranscoder = new JPEGTranscoder();
        // Set the transcoding hints.
        jpegTranscoder.addTranscodingHint(JPEGTranscoder.KEY_QUALITY, new Float(0.8));
        // Create the transcoder input.
        String inputString = getHeaders() + generateSVGString()//svgDoc is set from generateSVGString()
        TranscoderInput transcoderInput = new TranscoderInput(svgDoc);
        Reader stringReader = new StringReader(inputString);
        TranscoderInput transcoderInput2 = new TranscoderInput(stringReader);
        // Create the transcoder output.
        OutputStream osByteArray = new ByteArrayOutputStream();
        TranscoderOutput transcoderOutput = new TranscoderOutput(osByteArray);
        try {
            jpegTranscoder.transcode(transcoderInput2, transcoderOutput);
View Full Code Here


        JPEGTranscoder jpegTranscoder = new JPEGTranscoder();
        // Set the transcoding hints.
        jpegTranscoder.addTranscodingHint(JPEGTranscoder.KEY_QUALITY, new Float(0.8));
        // Create the transcoder input.
        String inputString = getHeaders() + generateSVGString();    //svgDoc is set from generateSVGString()
        TranscoderInput transcoderInput = new TranscoderInput(svgDoc);
        Reader stringReader = new StringReader(inputString);
        TranscoderInput transcoderInput2 = new TranscoderInput(stringReader);
        // Create the transcoder output.
        OutputStream osByteArray = new ByteArrayOutputStream();
        TranscoderOutput transcoderOutput = new TranscoderOutput(osByteArray);
        try {
            jpegTranscoder.transcode(transcoderInput2, transcoderOutput);
View Full Code Here

       
        //SVGDocument svgDoc = svg.getRootActivity().getSVGDocument();
       
        //TranscoderInput transcoderInput = new TranscoderInput(svgDoc);
        Reader stringReader = new StringReader(inputString);
        TranscoderInput transcoderInput = new TranscoderInput(stringReader);
       
        // Create the transcoder output.
        TranscoderOutput transcoderOutput = new TranscoderOutput(os);
        try {
            pngTranscoder.transcode(transcoderInput, transcoderOutput);
View Full Code Here

        jpegTranscoder.addTranscodingHint(JPEGTranscoder.KEY_QUALITY, new Float(0.8));
        // Create the transcoder input.
        String inputString = svg.getHeaders() + svg.generateSVGString();
       
        Reader stringReader = new StringReader(inputString);
        TranscoderInput transcoderInput2 = new TranscoderInput(stringReader);
       
        TranscoderOutput transcoderOutput = new TranscoderOutput(os);
        try {
            jpegTranscoder.transcode(transcoderInput2, transcoderOutput);
        } catch (TranscoderException te) {
View Full Code Here

     * Constructs a new SVGRasterizer.
     *
     * @param url the URL of the document to rasterize
     */
    public SVGRasterizer(URL url) {
        this.input = new TranscoderInput(url.toString());
    }
View Full Code Here

    }

    public SVGRasterizer(String filename) {
        File f = new File(filename);
        try {
            this.input = new TranscoderInput(f.toURL().toString());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
View Full Code Here

     *
     * @param istream the input stream that represents the SVG
     *        document to rasterize
     */
    public SVGRasterizer(InputStream istream) {
        this.input = new TranscoderInput(istream);
    }
View Full Code Here

     *
     * @param reader the reader that represents the SVG document to
     *        rasterize
     */
    public SVGRasterizer(Reader reader) {
        this.input = new TranscoderInput(reader);
    }
View Full Code Here

     * Constructs a new SVGRasterizer converter.
     *
     * @param document the SVG document to rasterize
     */
    public SVGRasterizer(SVGDocument document) {
        this.input = new TranscoderInput(document);
    }
View Full Code Here

        return outputImage;
    }
  
    private void transcode(String inputFile, BufferedImageTranscoder transcoder) throws Exception {
        InputStream in = new FileInputStream(inputFile);
        TranscoderInput input = new TranscoderInput(in);
        TranscoderOutput output = new TranscoderOutput();
        transcoder.transcode(input, output);   
    }
View Full Code Here

TOP

Related Classes of org.apache.batik.transcoder.TranscoderInput

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.