Please I need a link for a good tutorial/book on SVG in J2ME. I am thinking of doing a midlet, but want to avoid having to render the design using canvas. Moreover, Using the canvas might not give me the look and feel I desire
Did you search on the Google?. I suggest to use LWUIT.
The JSR 226 API can be used to render and manipulate SVG graphics on most J2ME devices.
The JSR 226 specification defines an API for rendering Scalable 2D Vector Graphics, including image files in SVG. It provides methods to load, render and manipulate external SVG files as well as creating SVG graphics programatically.
The drawback though is that it only supports SVG Tiny 1.1. Most of the graphical objects are there but there is no support for scripting nor audio/video. There is also the JSR 287 API to add support for SVG 1.2 but that API does not seem to be widely (if at all) adapted by the phone manufacturers.
You can find a good introduction to JSR 226 on Java.net. There are also some examples from Nokia and Sun.
You can replicate most of the SVG entities with the J2ME Graphics object when you paint a Canvas. It's a different syntax, but the same concepts.
Related
Does libGDX support rendering vector graphics? I need to draw some simple *.svg files, but can't find how to load them. Please advise
Nope it does not.
LibGDX provides you a way to draw simple shapes (implemented as ShapeRenderer) but it cannot parse .svg probably due to being multiplatform.
Still you can use some 3rd part library designed for specify platform like svg android
Also take a look at this:
Thread #1
Thread #2
I have developed a music player in javafx.
Is there any way to implement 3D audio effect similar to WOW EFFECT in windows media player.
I have searched there is no method of mediaplayer to implement such thing.
My javafx level: intermediate
AFAIK, the only effect that can be applied on the JavaFX MediaPlayer is an equalizer, with the javafx.scene.media.AudioEqualizer class. You can get the MediaPlayer's AudioEqualizer with the getAudioEqualizer method, and modify its existing bands, add/remove bands, etc.
However, if you want to implement other effects (reverb, delay, distortion... whatever else), I think you're out of luck: The JavaFX media API doesn't provide methods for that, and it doesn't seem to be meant to be extensible in any way (you can't add support for other codecs either, for example).
If you need more than what the JavaFX media API provides, the only solution for serious media playback in java seems to be to use a native library with a Java wrapper. vlcj (website here, Javadoc here) seems to be a good solution: it offers a java wrapper around VLC, which is a really powerful media player, so you should be able to do most of what you may want - worst case, it provides APIs to directly access the audio buffer and manipulate it yourself. It's clearly quite a bit more involved than using JavaFX's native media playback though...
I'm looking at some older code which is rendering some images, animations, etc... for a website by generating a web page containing significant SVG elements. The result is a fairly complicated, interactive, interface. I've been tasked with migrating the application to instead generate WebGL calls.
This is a non-trivial task, considering all of the niceties that come with SVG, which are not directly available if going straight to a WebGL implementation. I've been debating whether I should pitch migrating to using something like Three.js instead, but don't know enough about the available options to make a good decision.
What are some reasonable options I should consider when trying to build my battle plan here?
I would suggest you look at http://code.google.com/p/canvg/ as an option.
I assume it is using getContext("2d") not getContext("experimental-webgl") or getContext("webgl").
WebGL provides a 3d interface and I am not sure if there is any advantage to using it for 2d graphics, since you don't have any 3d transforms for the GPU to work on. If they are interested in Canvas not specifically webgl ... Canvg would bring over some of the niceties of SVG which would be the source content.
If the issue is lack of support for SVG in browsers http://code.google.com/p/svgweb/ goes a long way to solving that problem.
I need to create graphics for documentation, e.g. different functions of soft-keys or pin assignments for embedded systems with different firmware. My first thought was to use an SVG template, i.e. comfortably create the basic graphic with e.g. Inkscape and then use some XML library to set/replace respective strings for labels automatically. The SVG then can be embedded or rendered to any other format required.
I would like to know other ideas, or if there is some sort of standard method of doing this.
SVG is just XML, hence is fairly easy to generate.
You can easily generate SVG using XSLT: http://www.carto.net/papers/svg/samples/xslt/
Many programming languages provide efficient APIs for manipulating XML, which can also be applied to generate SVG. For example, I have had good success using Python and the lxml library.
I read while Googling that SVG was "dead". Although I disagree, could anyone tell me more/future vector based format to represent 2d/3d graphics? What about VML? What format should I use to represent 2D and 3D graphics on Web?
I playing around with graphics on web and I would like to know if I'm working with an obsolete technology.
Microsoft is supporting SVG in IE9, and gave a detailed explanation of why they were doing it on the IE blog:
http://blogs.msdn.com/b/ie/archive/2010/03/18/svg-in-ie9-roadmap.aspx
SVG's main advantage is that it becomes part of the DOM, so you can use CSS to style it and javascript to modify it. Canvas, by contrast, must redraw every frame completely. This makes canvas suited to spectrum analyzers, video processing, fast-paced games, and other non-gradual animations. SVG is better suited for gradual animations.
As far as 3D is concerned, the future is WebGL, a thin shim over OpenGL ES, but it's far off. Microsoft has not committed to supporting it, and that means it's not going to be in IE9. Maybe IE10, maybe not.
If you do use SVG, I recommend using svgweb to abstract away the browser differences (falls back to a flash applet on outdated browsers).
This post is rather late... but I think it is worth re-addressing, since your question has popped up again with all the html5 talk.
SVG is a vector drawing format that also supports animation, timing, and Javascript DOM support. In other words, it is a standalone format for static and dynamic vector graphics; you might say it is a web-focused (or screen-focused) alternative to EPS/PDF. The html5 canvas tag is not a format but a way to draw (static images) to the screen with Javascript — that is all; there is no competition between it and SVG, as they have entirely different purposes.
Most other vector "formats" involve plugins (Flash) or hardware support (webGL). Ironically, the VML format you mentioned is now deprecated in favor of SVG.
To answer your question: SVG is now the standard vector format for the web. Hopefully, in the near future, we will see it being used for video/animation as well.
You can try the Raphaël JavaScript Library.
It is easy to implement and provides the same UI features as SVG (and more!).
If it is SVG you are after the best way to go is svg.js. It supports SVG better and it is a fraction of the size (4.5k gzipped) of Raphaël (31k gzipped). It also has a very intuitive syntax.
All major browsers including ie9, firefox, safari and chrome are starting to supporting svg as part of the upcoming html5 standard. I wouldn't call that "dead"
2D: SVG
3D: X3DOM or webGL directly