Drawing Text to get a RGBSurface

I’m trying to print some text to Screen or Memory and then access the raw RGB values to send to a serial device. What would be the easiest way to do this?


Create a picture
drawstring on it
Then using the .rgbsurface of the picture, iterate over the .pixel(x,y) values
These are rgb colors
each has a .red .blue and .green property

If you have the MBS plugins, then
create a GMImageMBS from the picture,
then create a memoryblock from it using . CopyPixelsMemory and access the values directly from there in a loop

Order of pixel data is normally Red, Green, Blue, Opacity.

1 Like

Thanks Jeff, Got it