Roberto P. Well-Known Member Licensed User Longtime User Jan 12, 2015 #1 there is a tool that lets you convert an image file into byte array? This I need to send a file to print. thanks in advance
there is a tool that lets you convert an image file into byte array? This I need to send a file to print. thanks in advance
Erel B4X founder Staff member Licensed User Longtime User Jan 12, 2015 #2 Code: Dim bytes() As Byte = Bit.InputStreamToBytes(File.OpenInput(...)) Upvote 0
Roberto P. Well-Known Member Licensed User Longtime User Jan 12, 2015 #3 very good, I feel now. thanks Erel Upvote 0
Kwame Twum Active Member Licensed User Longtime User Oct 22, 2015 #4 Hello, please I tried using this tool to convert an image (.jpg) into byte array and got the following: error: incompatible types: byte[] cannot be converted to byte Need help please. Upvote 0
Hello, please I tried using this tool to convert an image (.jpg) into byte array and got the following: error: incompatible types: byte[] cannot be converted to byte Need help please.
Erel B4X founder Staff member Licensed User Longtime User Oct 22, 2015 #5 Please post the relevant code. Upvote 0
Kwame Twum Active Member Licensed User Longtime User Oct 22, 2015 #6 Erel said: Please post the relevant code. Click to expand... Code: Sub GetImageBytes() as Byte Dim bytes() As Byte = Bit.InputStreamToBytes(File.OpenInput(File.DirRootExternal,"MyApp/profile.jpg") Return bytes End Sub Upvote 0
Erel said: Please post the relevant code. Click to expand... Code: Sub GetImageBytes() as Byte Dim bytes() As Byte = Bit.InputStreamToBytes(File.OpenInput(File.DirRootExternal,"MyApp/profile.jpg") Return bytes End Sub
JordiCP Expert Licensed User Longtime User Oct 22, 2015 #7 The Sub should be declared to return an array, not a single byte. Code: Sub GetImageBytes() As Byte() '<---- Here Dim bytes() As Byte = Bit.InputStreamToBytes(File.OpenInput(File.DirRootExternal,"MyApp/profile.jpg")) '<--- Also, there was a missing closing ')' Return bytes End Sub Upvote 0
The Sub should be declared to return an array, not a single byte. Code: Sub GetImageBytes() As Byte() '<---- Here Dim bytes() As Byte = Bit.InputStreamToBytes(File.OpenInput(File.DirRootExternal,"MyApp/profile.jpg")) '<--- Also, there was a missing closing ')' Return bytes End Sub