Hi folks,
I have a working program drawing to the screen. I decided to add the ability to save the screen after a set number of iterations to a file. I used as a basis for my code the doc found here:
http://www.openframeworks.cc/documentat-…-il=ofImage
Following is the relevant code from my program:
void testApp::setup(){
counter=0;
ofBackground(150,150,250);
picout.allocate(ofGetScreenWidth(), ofGetScreenHeight(), OF_IMAGE_COLOR);
ofSetBackgroundAuto(false);
}
//--------------------------------------------------------------
void testApp::update(){
counter++;
if(counter > 500) {
picout.grabScreen(0,0,picout.width, picout.height);
picout.saveImage("test1.png");
std::exit(0);
}
}
To all appearances the program works fine and it creates the correctly sized output file. The problem is the output file is nothing but a black picture. So why does everything appear to work but produces an apparently empty PNG file?
Thanks.