I want a simple way to draw pixels in bigger shapes. I want to test basic pixel draw functions; like, lines, circles, rectangles … etc. With small resolutions like 128 x 64.
Even if you know a simple library that can be found on a C compiler, then that would be nice too. I tried to work with
graphics.h
In codeblocks but I got an error saying “cannot find -lbgi” and it got more complicated to setup this library.
So I thought to go back to processing because I remember I was able to draw some pixels before so I’m trying now and having some problems with the pixel size, that it’s too small for the resolution I want to work on.
I tried this simple example:
size(800, 800);
// Before we deal with pixels
loadPixels();
// Loop through every pixel
for (int i = 0; i < pixels.length; i++) {
// Pick a random number, 0 to 255
float rand = random(255);
// Create a grayscale color based on random number
color c = color(rand);
// Set pixel at that location to random color
pixels[i] = c;
}
// When we are finished dealing with pixels
updatePixels();
But as I mentioned the pixels are too small for me.
I want to simulate my pixels draw functions in C with processing or any other C compiler instead of uploading the code constantly to the microcontroller.
I want to practice on my computer monitor, for fast work process.