예제 #1
0
//--------------------------------------------------------------
void ofApp::update() {
    if(strokeIndex < currentTag.size()) {
        fbo.begin();
        ofClear(0, 0, 0, 0);
        ofSetColor(255, 255, 255);
        ofPushMatrix();
        ofTranslate(fbo.getWidth()/2, fbo.getHeight()/2);
        currentTag[strokeIndex].draw();
        ofPopMatrix();
        fbo.end();
        strokeIndex++;
        fboReader.readToPixels(fbo, pixels);
        ofImage img;
        img.setFromPixels(pixels);
        img.update();
        img.save("/PATH/TO/SAVE/"+ofToString(tagIndex)+"-"+ofToString(strokeIndex)+".png");
    } else {
        loadGML();
    }
}
//--------------------------------------------------------------
void bitmapManipulation::setup(){
	
	ofEnableAlphaBlending();
	ofSetFullscreen(true);

	last_tick_count = GetTickCount();

	logo.loadImage("gw_logo.png");

	logo1_dimensions = TouchObject(1360, 440, 200, 200, 0, 1);
	logo2_dimensions = TouchObject(560, 440, 200, 200, 0, 1);
		
	if(loadGestureWorks("GestureWorksCore.dll")) { 
		std::cout << "Error loading gestureworks dll" << std::endl; 
		exit(); 
	}
	if(!loadGML("basic_manipulation.gml")) { 
		std::cout << "Could not find gml file" << std::endl; 
		exit(); 
	}

	initializeGestureWorks(1920,1080);

	if( !registerWindowForTouchByName("Bitmap Manipulation") ) { 
		std::cout << "Could not register target window for touch." << std::endl; 
		exit(); 
	}

	registerTouchObject("logo1");
	registerTouchObject("logo2");

	addGesture("logo1","n-drag");
	addGesture("logo1","n-rotate");
	addGesture("logo1","n-scale");

	addGesture("logo2","n-drag");
	addGesture("logo2","n-rotate");
	addGesture("logo2","n-scale");

}