I have looked through the documentation and cannot find a quick way to convert an array of values to an image.
Let's say I have a 3-dimensional array sized N x M x 3. N x M is the size of my image in pixels, and I have three layers which contain R, G, and B values. (Or maybe I want to include a fourth layer with alpha values, or maybe only one layer for a black and white image.)
Currently I am looping through i (0 to N-1) and j (0 to M-1) values and drawing each pixel which is very time consuming. Is there a faster or simpler way to draw the image using data in this format that I'm missing?
Drawing image from array values
- Mr. Kibernetik
- Site Admin
- Posts: 4786
- Joined: Mon Nov 19, 2012 10:16 pm
- My devices: iPhone, iPad, MacBook
- Location: Russia
- Flag:
Re: Drawing image from array values
No, currently smart BASIC cannot work with raw bitmaps.
Depending on what kind of bitmap data you have, you can yourself create for example BMP image file (which is basically a raw bitmap) from your data and then draw it.
Depending on what kind of bitmap data you have, you can yourself create for example BMP image file (which is basically a raw bitmap) from your data and then draw it.
Re: Drawing image from array values
Ah, ok I will look into that. Thank you!