Anyone who knows how to write a JavaFX image to an array of bytes (and vice versa)?
If possible, I don't want to load from or write to disk. I want to use the Image in memory (like Bitmap in B4A).
There are examples online but Image in JavaFX is not the same as in normal Java so it has to be treated differently (I think).
Thanks. I tried your idea by implementing a class similar to the one found in this post on SO. It permitted me to serialize the image but apparently some information was being lost (related to the type of the image) because then TensorFlow gave an error since it was not recognized as a valid image-format (jpg, png, gif).
Not sure what you mean? That is a library made for B4X, right?
I needed java code to use within one of my java classes in a wrapper. Don't understand how I could use it within my wrapper or can I call its method, using composition, in my java-code?
I needed java code to use within one of my java classes in a wrapper. Don't understand how I could use it within my wrapper or can I call its method, using composition, in my java-code?
I don't have the complete context so my answer may not be relevant. However as a general rule the library code shouldn't do things that the developer can easily do in the B4X code. It is very simple to convert an image to an array of bytes and vice versa with BitmapCreator.
I agree with you. I guess I could change the exposed method to take a byte array instead of an Image-object.
I will review the code. Thanks for the idea.