Problems using ofImage.grabScreen() and draw()

My system is Mac Mini OSX Snow Leopard, of_preRelease_v0061_osxSL_FAT

I draw something with the mouse on the screen.
Then I grab the drawing with ofImage.
Then I try to draw, what I grabbed.

The problem is the following:

I draw a circle of radius 10.
Then I grab this part of the screen (say 100x100 pixels).
Then I draw the grabbed part of the screen somewhere else.

If the circle is red and 10 pixels in size, the grabbed part when drawn is a red square of size 100.

I don’t know why this happens. It looks like the ofImage only captures the color?

Yes I know that i can duplicate the screen easier with ofTexture, but I need to access the pixel data and this is only possible with ofImage.

Hm, cannot upload sample so I paste it at the end of this message …

Hopefully someone knows what I am doing wrong.


--------- sample testapp ----------------------
#ifndef _TEST_APP
#define _TEST_APP

#include “ofMain.h”

class testApp : public ofBaseApp{
void setup();
void update();
void draw();
void keyPressed(int key);
void keyReleased(int key);
void mouseMoved(int x, int y );
void mouseDragged(int x, int y, int button);
void mousePressed(int x, int y, int button);
void mouseReleased(int x, int y, int button);
void windowResized(int w, int h);

ofImage image;

#include “testApp.h”

void testApp::setup(){



void testApp::update(){

void testApp::draw(){
ofCircle(0, 0, 3);

image.grabScreen(0, 0, 20, 20);
image.draw(50, 50);

void testApp::keyPressed(int key){}
void testApp::keyReleased (int key){}
void testApp::mouseMoved(int x, int y ){}
void testApp::mouseDragged(int x, int y, int button){}
void testApp::mousePressed(int x, int y, int button){}
void testApp::mouseReleased(int x, int y, int button){}
void testApp::windowResized(int w, int h){}

In case you didn’t figure it out yet: you need to set the color to white before drawing your image. Otherwise it wil tint your image with the previous specified color (in this case red)

ofSetColor(255, 255, 255);  
image.draw(50, 50);