Re: Broken image, embedded PNG

Kevin Gamiel <[email protected]>
Newsgroups gmane.text.xml.batik.user
Message-ID <[email protected]>
Hmmm, this is my first batik app, probably missing something.

Here is a test app that demonstrates the problem.  I included a second URL in a comment that does work for comparison:

<code>
import javax.swing.*;
import java.awt.*;
import org.w3c.dom.svg.*;
import org.w3c.dom.*;
import org.apache.batik.swing.*;
import org.apache.batik.util.XMLResourceDescriptor;
import org.apache.batik.dom.svg.SAXSVGDocumentFactory;

public class TestPanel extends JFrame {
    public TestPanel() throws Exception {
        try {
            JPanel p = new JPanel();
            p.setLayout(null);
            p.setBounds(0, 0, 500, 500);
            JSVGCanvas canvas = new JSVGCanvas();
            canvas.setBounds(0, 0, 500, 500);
            p.add(canvas);
            String parser = XMLResourceDescriptor.getXMLParserClassName();
            SAXSVGDocumentFactory f = new SAXSVGDocumentFactory(parser);
            Document doc = f.createDocument(
                "http://www.renci.org/~kgamiel/web/gauge/img/Tick1.svg");
                // NOTE, works for this URL
                //"http://www.renci.org/~kgamiel/web/gauge/img/dial.svg");
            canvas.setDocument(doc);
            getContentPane().add(p);
            this.setBounds(0, 0, 500, 500);
        } catch(Exception e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) throws Exception {
        new TestPanel().setVisible(true);
    }
}
</code>

Kevin

--
RENCI
http://www.renci.org
Proud charter member of Tar Heel Information Services - "Nothing but Net!"

On Nov 1, 2011, at 12:15 AM, Zainab AlMeraj wrote:

> Hi,
> 
> I have loaded it onto a JSVGCanvas and it looks fine. 
> 
> The problem maybe something else.
> 
> Zainab
> 
> 
> 
> On Tue, Nov 1, 2011 at 12:00 AM, Kevin Gamiel <[email protected]> wrote:
> I have:
> 
> batik 1.7
> Java Plug-in 1.6.0_26
> Using JRE version 1.6.0_26-b03-383-11A511 Java HotSpot(TM) 64-Bit Server VM
> Chrome/Safari
> 
> Trying to load the following SVG using JSVGCanvas and it displays the "broken image".  I note that the SVG is an embedded PNG whereas the others I can successfully load are native SVG.
> 
> http://www.renci.org/~kgamiel/web/gauge/img/Tick1.svg
> 
> Any guidance appreciated!
> 
> Kevin
> 
> --
> RENCI
> http://www.renci.org
> Proud charter member of Tar Heel Information Services - "Nothing but Net!"
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.