B4J Question [B4X] [SOLVED] com.sun.javafx.tk.quantum.PrismImageLoader2$PrismLoadListener imageLoadWarning

MrKim

Well-Known Member
Licensed User
Longtime User
Edit: See post 5 below for solution.

Getting the following error in B4j same code in B4A has no error:
The picture loads just fine.

B4X:
Jan 16, 2021 11:49:18 PM com.sun.javafx.tk.quantum.PrismImageLoader2$PrismLoadListener imageLoadWarning
WARNING: null

I am retrieving a picture using HttpJob.
B4X:
        Dim H As HttpJob
        H.Initialize("H", Me)
        Dim FN As String = "XXXXXXXXXX.jpg"
        Dim FDir As String = "\\XXXX\yyyy\dwg"

        H.Download2($"http://${XXXXXXXXXX/getfile"$, Array As String("FileName", FDir & "\" & FN, "Dir", FDir))
        Wait For (H) JobDone(j As HttpJob)
        If j.Success Then
                TravPic.ResizeMode = "FIT" '"FILL_NO_DISTORTIONS"
                TravPic.Bitmap = j.GetBitmap   <<ERROR IS ON THIS LINE
.
.
 
Last edited:

MrKim

Well-Known Member
Licensed User
Longtime User
What is TravPic?

Can you upload a small example which shows the Issue?

Edit: Sorry I didn't answer the first part of your question. Travpic is a B4XImageView that is on the MainPage Layout and declared private in Class Globals.

I would have to give you the server as well and you would have to configure it and set up a path in the code to a file. I am actually working on something to upload and share. I well post here when I get that done.
 
Last edited:
Upvote 0

MrKim

Well-Known Member
Licensed User
Longtime User
After much handwringing because .bmp files didn't work at all, I found the problem and it was in the server. I misinterpreted the tooltip:


And had this:

resp.OutputStream.WriteBytes(B, 0, B.Length - 1)

instead of this:

resp.OutputStream.WriteBytes(B, 0, B.Length)

resulting in files that were one byte short.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…