Question

javaFX How do you save a 3-d image you just created and load it back?

javaFX

How do you save a 3-d image you just created and load it back?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

You can load the created image in JavaFX by instantiating the class named Image of the package javafx.scene.image.

To the constructor of the class, you have to pass either of the following −

  • An InputStream object of the image to be loaded or,

  • A string variable holding the URL for the image.

//Passing FileInputStream object as a parameter 
FileInputStream inputstream = new FileInputStream("C:\\images\\image.jpg"); 
Image image = new Image(inputstream); 
         
//Loading image from URL 
//Image image = new Image(new FileInputStream("url for the image));

After loading the image, you can set the view for the image by instantiating the ImageView class and passing the image to its constructor as follows −

ImageView imageView = new ImageView(image);
Add a comment
Know the answer?
Add Answer to:
javaFX How do you save a 3-d image you just created and load it back?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT