|
Post by pietroartoni on Jun 12, 2015 11:38:18 GMT -8
Hi, I am doing a project for visual stimulation in neuroscience. I need to create a 256x1 bitmap (greyscale) starting from an byte array[256] generated by the sketch on the arduino through a sin function. I need to create something to handle like a bitmap (rotation, shrink, etc..) I cannot use data from the SDcard. Is there any way to import an byte array to a 1-dimensional greyscale bitmap?
thank you in advance
Pietro
|
|
|
Post by jamesbowman on Jun 12, 2015 12:43:19 GMT -8
Sure, you can set up a bitmap to use the first 256 bytes in video memory:
GD.BitmapSource(0); GD.BitmapSize(NEAREST, BORDER, BORDER, 256, 1); GD.BitmapLayout(L8, 256, 1);
Then load the bitmap data from array[] like this:
for (int i = 0; i < 256; i++) GD.wr(i, array[i]); Does this make sense?
|
|
|
Post by pietroartoni on Jun 13, 2015 7:20:41 GMT -8
It works fine !
Thanks!
|
|