(sry for my english)
Hey, i have a problem and need your help. All i want is to grab images (sequences) from my camera and display them on screen with a size of 640/240. In addition i want to “save” and display a copy in half the size. (320/240) I just tried to copy the Grab by using
colorImg2 = colorImg; and resize it with
colorImg2.resize(320/240);
but this doesnt work… it displays only a quarter (the top-left corner) of the original Grab.
Here’s the code…
void testApp::setup(){
vidGrabber.setVerbose(true);
vidGrabber.initGrabber(640,480);
grabW = vidGrabber.width;
grabH = vidGrabber.height;
colorImg.allocate(grabW,grabH);
colorImg2.allocate(grabW/2,grabH/2);
}
//--------------------------------------------------------------
void testApp::update(){
ofBackground(100,100,100);
bool bNewFrame = false;
vidGrabber.grabFrame();
bNewFrame = vidGrabber.isFrameNew();
if (bNewFrame){
colorImg.setFromPixels(vidGrabber.getPixels(), grabW, grabH);
colorImg2 = colorImg;
colorImg2.resize(grabW/2, grabH/2);
}
}
//--------------------------------------------------------------
void testApp::draw(){
ofSetColor(0xffffff);
colorImg.draw(20,20);
colorImg2.draw(700,20);
}
this is what i got:
http://helpmode.de/trash/face1.jpg
Where is the Mistake?