Re: Drawing in a JSVGCanvas
Alice Cavallo wrote: I created one class that extends JSVGCanvas in order to trace an SVG image displayed on the canvas. I have created my own PaintComponent and other paint methods. It is not working. What's not working, your method isn't called, you don't see your drawing, it doesn't compile? The LoadSVGCanvas that I wrote is doing nothing at the movement of the mouse. Why are you loading the canvas on mouse move? Basically I replicated what I had implemented for a regular class that extends JPanel. My first guess would be you are drawing before the SVG content is drawn rather than after. Am I using the wrong class? Is there any other JSVG* class that should be used for the purpose of loading an image and also drawing on top of it? No I think you are using the correct class, but I suspect that you are not overriding the methods properly. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Drawing in a JSVGCanvas
In fact the problem came from the SVG file itself. the viewBox attribute didn't correspond to other information provided in the file. So all coordinates calculations was wrong (in my sense). I've found the problem by trying many changes in the SVG file. My problem is that I don't really understand all informations in that file. I should probably read more about SVG. Is there some interesting books or links you should recommend ? Thanks anyway. Gerard Thomas E Deweese a écrit : GB == Gerard BUNEL [EMAIL PROTECTED] writes: GB I already posted this mail in batik-users but this one is GB probably a best place. GB I'm using JSVGCanvas do display a Map. I've to dynamically draw GB points on this map. For my first test, I've overloaded the GB paint(Graphics g) method to do this job. The code for this is the GB following: So my guess is that you have some of the AffineTransform handling wrong (I would need to know a lot more about the context to know exactly where - for example it is possible that at the end of super.paint(g) the rendering transform has already been applied). The simpliest thing to do is just print out the various transforms to figure out what is going on (g2d.getTransform() will tell you the transform already in the Graphics2D). If you aren't really used to working with them this is the only way you will get anywhere. I am really used to working with them and except for really simple cases I have to stop and think for a while before I can just write the code. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- [EMAIL PROTECTED] - Atlantide - http://www.ago.fr/atlantide/ Technopole Brest Iroise BP 80802 - 29608 Brest cedex - France - Tel. : +33 (0)2 98 05 43 21 - Fax. : +33 (0)2 98 05 20 34 - e-mail: [EMAIL PROTECTED] Centre Affaires Oberthur - 74D, rue de Paris - 35700 Rennes - France Tel. : +33 (0)2 99 84 15 84 - Fax : +33 (0)2 99 84 15 85 - e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Drawing in a JSVGCanvas
GB == Gerard BUNEL [EMAIL PROTECTED] writes: GB I already posted this mail in batik-users but this one is GB probably a best place. GB I'm using JSVGCanvas do display a Map. I've to dynamically draw GB points on this map. For my first test, I've overloaded the GB paint(Graphics g) method to do this job. The code for this is the GB following: So my guess is that you have some of the AffineTransform handling wrong (I would need to know a lot more about the context to know exactly where - for example it is possible that at the end of super.paint(g) the rendering transform has already been applied). The simpliest thing to do is just print out the various transforms to figure out what is going on (g2d.getTransform() will tell you the transform already in the Graphics2D). If you aren't really used to working with them this is the only way you will get anywhere. I am really used to working with them and except for really simple cases I have to stop and think for a while before I can just write the code. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]