Making image from array
in
Programming Questions
•
1 year ago
Hey guys. I have array of pixel colors, and I need img. When i use this code, nothing is return. What the problem?
void draw(){
m.update();//update the camera view
int[] img = m.image(); //get the normal image of the camera
PImage imgz = createImage(width, height, RGB);
imgz.loadPixels();
loadPixels();
for(int i=0;i<width*height;i++){ //loop through all the pixels
pixels[i] = img[i]; //draw each pixel to the screen
imgz.pixels[i] = img[i];
}
imgz.updatePixels();
image(imgz, 0, 0);
updatePixels();
}
1