Place and retrieve images Java 3d - java

I have no working experience of Java3d what so ever so I needed a quick information
where should I place images that I want to use in my project like the background of the panel
like we have Drawable folder in android.
and also I have seen that the background need the image as ImageComponent2d how to convert that retrieved image to that format
searched for it all around but no good tutorial was available
Any help is appreciated thanks in advace

Put the images on the run-time class path of the application (is the quick answer).

Related

How to create a video from a series of images with transition

I want to create a video from a series of images and add a transition between the images (e.g., fade in and fade out). I’m looking for a Java solution and not a C++ one (FFmpeg or anything else).
I checked out JCodec and MediaCodec, but none of those support image transitions.
Have you already tried it with OpenCV for Java? OpenCV offers almost everything you need for such a task. To the transitions you would have to worry about then manually with image blending. But that can be solved with OpenCV too. Just take a look at the documentary
EDIT:
It looks like the Java API lacks the appropriate module that can encode a sequence of images. You can fade images in any case. Take a look at the tutorial. This means you would have to crossfade the images with OpenCV and then use another API (e.g. jcodec) to make a video from the images you create.

Best way to display scalable graphics as icons in JavaFX?

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/

Image dimensions for imageView

Okay so i have pictures on server. I would like to display them in my app as a part of a ListView row. I've already made that and now I have a question regarding the dimensions of the pictures. Since its a bad idea to save my image at 48dp sizes on server (36x36, 48x48, 72x72, 96x96 ..) and then download specific one for specific DPI device. Is it possible to only save a 96x96 and then set it to an ImageView. ImageView width and width = 48dp, and scaleType= fitCenter. Are there any better ways? please help me
You're right that you need only one image size on a remote server like 96px and then in Android app just fit it to your needs like 48px.
The easiest way to implement it would be using Picasso library.
Of course, there is a Glide, with many extra features, (so it might look at the beginnig a bit complicated for beginners), but for the most of uses Picasso is a enough solution.
You can also try a new library developed by Facebook, called Fresco,if you care also about memory using but I highly recommend you a Picasso.
Here you would find nice tutorial for this library:
https://futurestud.io/blog/picasso-image-resizing-scaling-and-fit
If you would find more information about these three libraries visit this site
Fragmented Podcast - 005 – Image libraries for Android
You can use Glide or Picasso for that. It's very easy to implement.
Here is a guide that explains a little as the two libraries and do what you ask.

Image Edit SDK for Android?

I'm working on a project that requires taking pictures and putting stickers on that photo. From what I understand this requires 3 main actions:
1. User should be able to resize the sticker.
2. User should be able to rotate the sticker.
3. And once done, the whole thing should be merged into a single image.
I'm having a really hard time starting this since I simply don't know where I should start. Should I find, or ever write my own code to do the above, or maybe try to use existing projects (but I was not able to find any open-source ones).
I've heard about Aviary, but it was recently purchased by Adobe, and it is now part of the Creative Cloud, which is quite vague regarding the price, if there is any.
Where should I start?
Thanks.
We at Img.ly have released an image editing SDK for Android as part of our PhotoEditorSDK product suite.
Users can resize rotate and adjust stickers out of the box and you can also add your own stickers and assets.
You can find a demo application here. You can use the library for free in your open source projects, but there is a license fee for commercial applications.
For Resizing the image add two buttons one for increasing the image size and the other for decreasing . Then in the set an onClickListener() for that buttons.
Inside that function first get the dimensions of the image using getWidth() and getHeight() , then use setWidth() and setHeight() to change the size.
for Rotating the sticker refer this link
After all these things use a canvas to save the sticker and image as a single file . for doing this refer this link.
In future do not combine all your queries in a single question.
I use these libraries and plugins in my projects
for cropping an image use this : Cropper
for rotating an image you can use this: PhotoProcessing
and at the end you can get the whole image in to a single image-view

How to load a simple 3d image with java3d

I want know how to load an image and move it on screen. I know that I can use textureloader() to load an image, but I don't know how to display it on the screen.
Can anyone provide some code or a link that can display a texture on the screen?
Mehdi, take a look at these articles as they will show you what you need to do.
Specifically: http://java.sun.com/developer/onlineTraining/java3d/
This will give you all the tutorials you will need for Java3d
For loading a basic texture and putting it in a scene, look at this tutorial:
http://java.sun.com/developer/onlineTraining/java3d/j3d_tutorial_ch7.pdf
Specifically, go to section 7.2 and it should explain how to do all of that.
Good luck,

Categories