Hi
I was wanting to know if you can include a byte array stored image in on arduino hosted webserver? I have done it with images on an SD card but not images stored in byte arrays
thoughts?
Hi
I was wanting to know if you can include a byte array stored image in on arduino hosted webserver? I have done it with images on an SD card but not images stored in byte arrays
thoughts?
You have to convert the data into one of the normal image files, like and *.ico, *.png, *.jpg or so.
When you do that while the webpage is being requested, it might slow things down. But it will work.
Now what about the byte array ? Where does it come from ?
Perhaps there is a different way to do things.
When the byte array contains data that was collected by the Arduino, perhaps the data can be used to produce graphics with HTML5.
When the byte array was generated in a different way, perhaps the Arduino can convert it to an image file in the background.
As Peter_n says, if you only have raw data, you can use HTML5
A combination of JavaScript to read the data, and a element to draw into will do the trick.
Using JavaScript as a helper allows you to store the data in a hidden HTML element you send with the page, or it can even use an ajax request to get the data later.
There would almost certainly be a library here that will do what you want: http://www.cdnjs.com/ Very useful if the browser connecting to the Arduino can also access the internet.
Horendus:
HiI was wanting to know if you can include a byte array stored image in on arduino hosted webserver? I have done it with images on an SD card but not images stored in byte arrays
Ultimately it's just a sequence of bytes, wherever it's stored, but the size of image you could afford to store like that would be pretty limited. You'd need to provide your own method of populating the rest of the HTTP response such as the encoding, which you might infer from the file suffix for documents that are stored in files.
Im already storing the image / logo in a byte array for use on the projects 3.2' LCD screen.
Its just that also wanted it visible on the web interface im building for it which is using the adafruit CC3000 wifi board. (Great product!)
In that case you just need to write the byte stream into the appropriate HTTP response, and you'll need to provide the rest of the HTTP response fields such as size and encoding. However, if you're planning to implement your entire web user interface using pages stored in program memory, you're going to have very limited space available.