Hi Charly,
[EMAIL PROTECTED] wrote on 03/07/2006 06:49:22 AM:
> I still want to draw an svg to my graphics context. I tried the
following
> little java programm without success. I would have expected that the svg
> woulb be drawn to my frame. (At least after waiting some time to give
the
> app the chance to load the svg file and then forcing the frame to be
redrawn
> ...)
>
> What am I missing here?
You haven't provided a size for the JSVGCanvas, so it's size is zero.
As to what an affine transform is see the JavaDocs for:
java.awt.geom.AffineTransform
Take a look at the Batik Wiki:
http://wiki.apache.org/xmlgraphics-batik/BootSvgAndCssDom
The 'rootGN' has a method called 'paint' that takes
a java Graphics2D.
> Thanks
> Charly
>
>
> import java.awt.Graphics;
> import java.awt.Graphics2D;
> import java.awt.Color;
> import java.awt.geom.AffineTransform;
>
> import javax.swing.JFrame;
> import javax.swing.JPanel;
>
> import org.apache.batik.swing.JSVGCanvas;
>
> public class xmt extends JFrame
> {
> public static void main(String[] args) {
> xmt myFrame = new xmt();
> myFrame.setSize(400,400);
> myFrame.setVisible(true);
> }
>
> private JSVGCanvas svg;
>
> xmt() {
> svg = new JSVGCanvas();
> svg.setURI("file:../fc02.svg");
> }
>
>
> public void paint(Graphics g) {
> System.out.println("paint");
> super.paint(g);
> // svg.setPaintingTransform(new AffineTransform(0.5, 0.0, 0.0, 0.5,
> 100.0, 100.0));
> svg.paintComponent(g);
> }
> }
>
> --
> "Feel free" mit GMX FreeMail!
> Monat für Monat 10 FreeSMS inklusive! http://www.gmx.net
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]