Hi,
I want to develop a function that put a pixel on the main image buffer.
Because I want to draw a bitmap from 1024 byte array.
This what I got so far:
PImage pi;
void draw_pixel(int x,int y){
pi = createImage(1280, 640, RGB); // I think this could be temporary pixel buffer with related main image dimensions
scale(10); // increase size of pixel
pi.loadPixels();
pi.pixels[x] = color(0); // draw pixel at specified buffer location
pi.updatePixels();
image(pi, x, y); // I don't know much about this line but I think it's for uploading the final buffer copy to the image pointer
}
void setup(){
size(1280, 640);
background(255);
noSmooth();
draw_pixel(2,1); // call the function to put a pixel at x = 2, y = 1
}