loadTexture with BufferedImage

Hello !





I am using JFreeChart to generate a chart (seriously ? :P).

This chart gives me a bufferedImage (in 2D)



Then I want to display it on the screen (with transparency)

Also, this bufferedImage will update every second.



Since I am a beginner, I really don’t know if what I’ve done until now is fine.



-I created a “flat” box

-I created a material

-I created a texture

And I want it to loadTexture(from BufferedImage) with my BufferedImage from JFreeChart.



But it asks for some special arguments minification and magnification Filter.

What are these things ?



-Is my method correct ?

-How do I load a bufferedImage then display it on the screen ?





Kind regards,



B.Az

Step 1:

http://hub.jmonkeyengine.org/javadoc/com/jme3/texture/plugins/AWTLoader.html#load(java.awt.image.BufferedImage,%20boolean)



Step 2:

http://hub.jmonkeyengine.org/javadoc/com/jme3/texture/Texture2D.html#Texture2D(com.jme3.texture.Image)



Step 3:

Use a Quad not a “flat box”.

http://hub.jmonkeyengine.org/javadoc/com/jme3/scene/shape/Quad.html

1 Like

Wow !



Thanks A LOT pspeed !



That seriously helped me a lot !