ofImage.setColor() not working

I guess this should be pretty simple, but when I draw the image I’m getting a short white line followed by a bunch of random pixel colors. Can someone explain to me why / what I’m doing wrong? Thanks. Screenshot attached below.

//header
ofImage strip;

//cpp file
//--------------------------------------------------------------
void VisualSystem::setup(){
    strip.allocate(75, 1, OF_IMAGE_COLOR);
}

//--------------------------------------------------------------
void VisualSystem::update(){
   //set pixels of image object
    for(int i=0; i<strip.getWidth(); i++){
        ofColor c;
        c.set(255, 0, 0);
        strip.setColor(i, c);
    }
    strip.update();
}

//--------------------------------------------------------------
void VisualSystem::draw(int x, int y){
    strip.draw(x, y);
}

First of all, what do you want to do?

Hi @JackKalish

I guess you want to change this to

strip.setColor(i,0,c);

so it can color the x,y pixel coordinates in the image. (int x, int y, ofColor color)

Hi, thanks for your response.

strip.setColor(i,0,c); works!
strip.setColor(i, c); seems like its using the pixelbuffer index, instead of the pixel index. I found that doing strip.setColor(i*3, c); also works.