I want to be able to draw and erase on an image in java (NOT javascript). Are there any APIs for that? Bonus points if i can also draw vectors, but it's not necessary. I want to use it in my program, so I'm not looking for a stand alone program. Thank you!
Why not use the graphics classes built into java? There is a simple tutorial for this here. You really just need to get a graphics context and then you can draw whatever you like on the image.
Another option would be to use Processing
diagrams and images can be drawn using an API that can produce SVG images. I can remember two API's that are capable of this. One of them is Batik and the other is SVG Salamander.
Related
I want to know if there is a possibility to use svg graphics with libgdx. I know that Libgdx itself can not handle svgs but is there a possibility with an extension or a method which pre creates PNG's/JPG's out of the SVG's and pass them to Libgdx?
No, currently not supported.
For simple shape rendering you can use ShapeRenderer. You can't parse .svg file because of cross platform support.
For android you can use https://github.com/pents90/svg-android
Also check this thread, It may be helpful.
I am making a desktop app using JavaFX as the GUI Framework. I wan't my app to scale at any DPI, so I want sharp icons whether the app is run on a 1024x768 or 4K screen. In HTML achieving this is pretty easy with SVG, however I have not found a way to display scalable graphics directly in JavaFX.
What is the best way to achieve this? The app will obviously contain many icons, so I need it to be light and fast. Frankly, I haven't found anything close to what I want searching Google.
Thanks for your help!
Here is a library that you might want to have a look at:
JavaFXSVG
In addition to mipa's answer, I have similarly solved my problem using svg2fxml, available here: https://tomsondev.bestsolution.at/2012/08/22/svg-to-fxml-converter-as-commandline-util/
I am developing an application in android.In this application I want to find the shape of an object in a black and white snaps. If i have a triangular object in the snap then i want to find the angle between the edges of the objects programmatically. I do not want to draw the line manually on the object and find the angle. My actual need is that scan the image and find angle of the object using objects pixel intensity.
Can anyone please suggest me how to proceed for this work.
Thanks in advance.
The OpenCV library, which can be built for Android, can perform such shape detection. Here's a tutorial about triangle and other shapes detection. It shows how to extract vertices, from which you should be able to get angles easily. It's in C# but should be easy to port to C.
I don't think that you'll find a ready-to-use OpenCV Java binding for Android. But using the Android NDK, you could encapsulate calls to the OpenCV C API, and expose a few functions in Java through JNI. A google search about "opencv android java" yields a couple of tips.
Not really sure if this is a good solution for a mobile device, but it sounds like you should use a Hough transform to find the lines, and then find a triangle using those lines.
It sounds like you need to use some Edge detection, Which is what Hough transform is part of. There are many different complex approaches to this process, but this is definitely a starting point to read up on.
I'm trying to draw text to an image from Java in the Google App engine, but I've found no methods (since the java.awt.image.* isn't whitelisted) to do it with. I'm also trying to "layer" one image on top of another, which I can't figure out how to do.
Is there any way to draw text on an image or overlay one image over another in App Engine using Java? Has anyone found any other solutions to this?
You have to use Google's Images API instead.
Not sure if it can do all you need it to, but it does include image composition.
i need to develop simple 3d application ( i don't know if its going to be java or c++ )
now how to use 3d engine i know , but in the end i need to produce rendered image or movie
out of the 3d scene.
who should i do it in application ?
If you need an image with really good quality I think you should use a 3D engine with ray tracing.
Implementing a raytracer might not be a easy task, so my recommendation is to use an existing one, like for example POV-Ray. I think it's possible to embed it in other applications. Raytracing stills takes some time, so the rendering will not be in real time.
In Java you can use Java3D but you will need some work.
Java 3D API
http://java.sun.com/developer/onlineTraining/java3d/
At
http://www.javalobby.org/articles/ultimate-image/#4
you'll find a description on how to render images to an Image instance, and how to save that to a file in Java