walterf25 Expert Licensed User Longtime User May 24, 2012 #1 hello everyone, i'm very close to finishing my app, i'm stuck trying to reconstruct an image from a byte array, i'm receiving the byte array from an application written in visual studio 2008, everything else works just fine. i have this code given to me by Poseidon who has been kind enough to share it with me but i get an error saying "error loading bitmap" I will really appreciate it if someone can help me figure this out Code: Copy Dim InputStream1 As InputStream InputStream1.InitializeFromBytesArray(msg1, 0, msg1.Length) 'msg1 contains the data received from the server. Dim bitmap1 As Bitmap bitmap1.Initialize2(InputStream1) imageview2.Bitmap = bitmap1 thanks everyone, Walter
hello everyone, i'm very close to finishing my app, i'm stuck trying to reconstruct an image from a byte array, i'm receiving the byte array from an application written in visual studio 2008, everything else works just fine. i have this code given to me by Poseidon who has been kind enough to share it with me but i get an error saying "error loading bitmap" I will really appreciate it if someone can help me figure this out Code: Copy Dim InputStream1 As InputStream InputStream1.InitializeFromBytesArray(msg1, 0, msg1.Length) 'msg1 contains the data received from the server. Dim bitmap1 As Bitmap bitmap1.Initialize2(InputStream1) imageview2.Bitmap = bitmap1 thanks everyone, Walter
B Bill Norris Active Member Licensed User Longtime User May 25, 2012 #2 RE: Walter -- I don't know if this will help but I had a similar problem when downloading image files from server. Try inserting the following line Code: Copy inputstream1.close after your line Code: Copy InputStream1.InitializeFromBytesArray(msg1, 0, msg1.Length) 'msg1 contains the data received from the server. Upvote 0
RE: Walter -- I don't know if this will help but I had a similar problem when downloading image files from server. Try inserting the following line Code: Copy inputstream1.close after your line Code: Copy InputStream1.InitializeFromBytesArray(msg1, 0, msg1.Length) 'msg1 contains the data received from the server.
Erel B4X founder Staff member Licensed User Longtime User May 25, 2012 #3 Closing the input stream will not help. The problem is probably in the data itself. Upvote 0
walterf25 Expert Licensed User Longtime User May 25, 2012 #4 Please Help Erel said: Closing the input stream will not help. The problem is probably in the data itself. Click to expand... Hi Erel, but when i run the file through an online service to decode the data it works just fine, you mentioned in my other post that the file begins with the UTF8 BOM Marking, if this is the case why does the online service processes the file just fine and b4a doesn't. Free Usenet Tools - Online Base64 Encoder and Decoder. Usenet newsgroups binaries. this is the website i use to decode the text file, when i decode the file, i can see the image just fine. Upvote 0
Please Help Erel said: Closing the input stream will not help. The problem is probably in the data itself. Click to expand... Hi Erel, but when i run the file through an online service to decode the data it works just fine, you mentioned in my other post that the file begins with the UTF8 BOM Marking, if this is the case why does the online service processes the file just fine and b4a doesn't. Free Usenet Tools - Online Base64 Encoder and Decoder. Usenet newsgroups binaries. this is the website i use to decode the text file, when i decode the file, i can see the image just fine.
Erel B4X founder Staff member Licensed User Longtime User May 25, 2012 #5 I'm sorry but you posted this question in 3 or 4 threads. Please keep the posts in a single thread. Upvote 0