I have the following working code which reads in
a PNG graphic and displays it on screen. It uses ImageIO and is fairly simple.
I have the same symbols in SVG format. I have downloaded Batik from Apache,
but I can't for the life of me find code to simply load the image and display
it on screen. Can someone direct me to working code that does this.
Thanks,
Chris
-------------------------------------
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import javax.imageio.*;
public class Example01 extends Frame
{
public static void main(String args[])
{
new Example01();
}
public Example01()
{
super("Java 2D Example01");
setSize(400,300);
setVisible(true);
addWindowListener(new WindowAdapter()
{public void windowClosing(WindowEvent e)
{dispose(); System.exit(0);}}
);
}
public void paint(Graphics g)
{
Graphics2D g2d = (Graphics2D)g;
try
{
Image bi = ImageIO.read(new File("burda_knitthruback.png"));
g2d.drawImage(bi, 40, 40, 50, 50, this);
}
catch(IOException ioe)
{
System.err.println(ioe.getMessage());
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
- Re: How to display SVG on screen using Batik Chris
- Re: How to display SVG on screen using Batik Tonny Kohar
- How to display SVG on screen using Batik Chris
- Re: How to display SVG on screen using Batik Tonny Kohar
- Re: How to display SVG on screen using Batik Thomas DeWeese