ofSaveFrame ofSaveScreen not working windows

I’m trying to save a image with ofSaveFrame, ofSaveScreen or ofSaveViewport and it’s only saving a blank file
thanks

Hi tom, can you paste your testApp.cpp code?

I just tried in Ubuntu with 07 and 062, it saves the image but in windows with 07 and 062 openframeworks it just saves a black file

#include “testApp.h”
static int width;
static int height;

float noiseVal;
float noiseValX;
float noiseValY;
float changeX;
float changeY;
float posX;
float posY;
float theta;

//--------------------------------------------------------------
void testApp::setup(){
ofSetBackgroundAuto(false);
ofSetFrameRate(20);
ofEnableAlphaBlending();
ofSetVerticalSync(true);
ofEnableSmoothing();
width = ofGetWidth();
height = ofGetHeight();

noiseVal = 0.02;
noiseValX = 0.01;
noiseValY = 0.03;

changeX = 0;
changeY = 0;
}
//--------------------------------------------------------------
void testApp::update(){
width = ofGetWidth();
height = ofGetHeight();

noiseVal += 0.005;
noiseValX += 0.008;
noiseValY += 0.007;
theta +=0.002;

changeX = ofNoise(noiseVal, noiseValX);
changeY = ofNoise(noiseVal, noiseValY);
posX = changeX*cos(theta)*sin(theta);
posY = changeY*sin(theta)*sin(theta);
}
//--------------------------------------------------------------
void testApp::draw(){
ofSetColor(0, 0, 0, 4);
ofRect(0, 0, width, height);
ofPushMatrix();
ofTranslate(width/2, height/2);

ofSetLineWidth(3.0);
for(int i =1; i < 60; i++){
ofSetColor( ofGetFrameNum()%50 + 120 + i, 40);
ofLine( posX + cos(theta*i*5)*i*5, i*5*sin(theta*i*5) +posY, i*10*cos(theta*i*3) + posX, posY + i*10*sin(theta*i*3));
}

ofBeginShape();
ofSetColor(0, 0, 90 + ofRandom(20), 30);
for(int i = 0; i < 60; i++){
ofVertex( posX + cos(theta*i*5)*i*5, i*5*sin(theta*i*5) +posY);
ofVertex( i*10*cos(theta*i*3) + posX, posY + i*10*sin(theta*i*3));
}
ofEndShape();

ofSetColor(0, 0, 20 + ofRandom(20), 20);
for(int i = 0; i < 90; i++){
ofVertex( posX + cos(theta*i*7)*i*7, i*7*sin(theta*i*7) +posY);
ofVertex( i*2*cos(theta*i*2) + posX, posY + i*2*sin(theta*i*2));
}
ofEndShape();

ofPopMatrix();
}

(hmm my post is gone (?!)).

tomLen, I posted yesterday but somehow it’s not here… well
it was a short one:

where is the call to ofSaveFrame() in your pasted code?

yeah ofSaveFrame is in keyPressed

it just saves a black .png image in windows, I tried in windows with almost the same layout but it keeps saving an empty file, but in ubunutu it saves fine

#include “testApp.h”
static int width;
static int height;
float noiseVal;
float noiseValX;
float noiseValY;

float changeX;
float changeY;

float posX;
float posY;

float theta;
//--------------------------------------------------------------
void testApp::setup(){
ofSetBackgroundAuto(false);
ofSetFrameRate(20);
ofEnableAlphaBlending();
ofSetVerticalSync(true);
ofEnableSmoothing();
//rotateView = true;
width = ofGetWidth();
height = ofGetHeight();

noiseVal = 0.02;
noiseValX = 0.01;
noiseValY = 0.03;

changeX = 0;
changeY = 0;
}

//--------------------------------------------------------------
void testApp::update(){
width = ofGetWidth();
height = ofGetHeight();

noiseVal += 0.005;
noiseValX += 0.008;
noiseValY += 0.007;
theta +=0.002;

changeX = ofNoise(noiseVal, noiseValX);
changeY = ofNoise(noiseVal, noiseValY);

posX = changeX*cos(theta)*sin(theta);
posY = changeY*sin(theta)*sin(theta);
}

//--------------------------------------------------------------
void testApp::draw(){
ofSetColor(0, 0, 0, 4);
ofRect(0, 0, width, height);
ofPushMatrix();
ofTranslate(width/2, height/2);

ofSetLineWidth(3.0);
for(int i =1; i < 60; i++){
ofSetColor( ofGetFrameNum()%50 + 120 + i, 40);
ofLine( posX + cos(theta*i*5)*i*5, i*5*sin(theta*i*5) +posY, i*10*cos(theta*i*3) + posX, posY + i*10*sin(theta*i*3));
}

ofBeginShape();
ofSetColor(0, 0, 90 + ofRandom(20), 30);
for(int i = 0; i < 60; i++){
ofVertex( posX + cos(theta*i*5)*i*5, i*5*sin(theta*i*5) +posY);
ofVertex( i*10*cos(theta*i*3) + posX, posY + i*10*sin(theta*i*3));
}
ofEndShape();

ofBeginShape();
ofSetColor(0, 0, 20 + ofRandom(20), 20);
for(int i = 0; i < 90; i++){
ofVertex( posX + cos(theta*i*7)*i*7, i*7*sin(theta*i*7) +posY);
ofVertex( i*2*cos(theta*i*2) + posX, posY + i*2*sin(theta*i*2));
}
ofEndShape();
ofPopMatrix();
}

//--------------------------------------------------------------
void testApp::keyPressed(int key){
switch(key){
case ‘a’:
ofSaveFrame();
break;
}
}