loading an image file and rotating it

im currently stuck on this. ive tried this using ofimage

  
  
void testApp::draw(){	  
	ofPushMatrix();  
	f+=1;  
	gears.setAnchorPercent(0.5f, 0.5f);  
	ofRotate(f);  
	gears.draw(600,0);  
	ofPopMatrix();  
  

which results in the image rotating around the top left point of the screen as its centre.

and ive tried the ofximage addon with its own rotate but that results in a black bouncing box always surrounding the rotating image.

i fixed it, i remembered you should transform before rotate and my transform didnt do much so i draw at 0,0 in the draw() function. basically its this

  
  
  
        f+=1  
  
	ofPushMatrix()  
	ofTranslate(200,200,0);  
	gears.setAnchorPercent(0.5f, 0.5f);  
	ofRotate(f);  
	gears.draw(0,0);  
	ofPopMatrix();