B4J Question Image Writetostream in Raspberry Pi 3

pevguitars

Member
Licensed User
Longtime User
I am attempting to save an image using the image.writetostream.
In the B4J Win debugger it works but when run in Raspberry Pi 3 it throws the following errors:-
B4X:
main._mprint (java line: 1205)
java.lang.NoClassDefFoundError: javafx/embed/swing/SwingFXUtils
    at anywheresoftware.b4j.objects.ImageViewWrapper$ImageWrapper.WriteToStream(ImageViewWrapper.java:177)
    at b4j.example.main._mprint(main.java:1205)
    at b4j.example.main._mm_action(main.java:1089)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93)
    at anywheresoftware.b4a.BA$2.run(BA.java:165)
    at com.sun.javafx.application.PlatformImpl.lambda$null$170(PlatformImpl.java:295)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.application.PlatformImpl.lambda$runLater$171(PlatformImpl.java:294)
    at com.sun.glass.ui.monocle.RunnableProcessor.runLoop(RunnableProcessor.java:92)
    at com.sun.glass.ui.monocle.RunnableProcessor.run(RunnableP
rocessor.java:51)
    at java.lang.Thread.run(Thread.java:745)
etc
    ... 15 more

Here is the code I am using
B4X:
Dim Bitmap1 As Image
Dim out As OutputStream
  
    Bitmap1 = Ctx.Snapshot
    out = File.OpenOutput(File.DirApp,"test.png",False)
    Bitmap1.WriteToStream(out)
    out.Close

Any help greatly appreciated.
Peter V
 

pevguitars

Member
Licensed User
Longtime User
Yes thank you Erel, I thought that may be the case..
Is there possible alternative coding?

I have updated Debian, and have the Javafx as recommended.

Peter V
 
Upvote 0

pevguitars

Member
Licensed User
Longtime User
Thank you Erel.

I am attempting to find a way to print images from the Pi 3 captured from a canvas by snapshot.

I have loaded cups and my printer is recognised. It prints text files; so far unable to print images from my b4j apps.

I have tried jFX8Print library and that also complains about missing classes.

I beginning to suspect that the Pi 3 is unable to support some of these processes without major OS additions.

I have been converting some of my B4A guitar making tools to B4J Raspberry Pi 3 with surprising success; this printing issue is the only part not working..
 
Upvote 0

pevguitars

Member
Licensed User
Longtime User
No. I am using the scheme suggested elsewhere in this forum. Has SDK 8.0_73 and arm package. For me everything works except image saving by writetostream..

I have looked at page suggested and I will try to make an installation on another sd card..

Thank you again for your help.
 
Upvote 0
Top