summaryrefslogtreecommitdiff
path: root/menuApp/src/ofApp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'menuApp/src/ofApp.cpp')
-rw-r--r--menuApp/src/ofApp.cpp28
1 files changed, 23 insertions, 5 deletions
diff --git a/menuApp/src/ofApp.cpp b/menuApp/src/ofApp.cpp
index e19e239..25990a1 100644
--- a/menuApp/src/ofApp.cpp
+++ b/menuApp/src/ofApp.cpp
@@ -29,7 +29,7 @@ bool ofApp::loadInstagramFeed(){
}
*/
items.clear();
- items.resize(IMAGE_SLOTS);
+ //items.resize(IMAGE_SLOTS);
instagram.getUserRecentMedia("self");
//instagram.getUserLikedMedia(12);
@@ -87,7 +87,7 @@ bool ofApp::loadInstagramFeed(){
if (interesting){
- items[slot]=menuItem(caption,price);
+ items.push_back(menuItem(caption,price));
//items[slot]=menuItem(test[i],price);
std::string id=instagram.getImageID()[i];
@@ -141,7 +141,7 @@ void ofApp::setup(){
ofLog(OF_LOG_NOTICE) << "code for € is " << ((int)str.at(0)) << " not " << 0xA4;
ofLog(OF_LOG_NOTICE) << "-30 as uint8_t is " << ((int)((uint8_t)-30));
*/
- items.resize(IMAGE_SLOTS);
+ //items.resize(IMAGE_SLOTS);
ofTrueTypeFont::setGlobalDpi(150);
@@ -190,6 +190,14 @@ void ofApp::draw(){
loadInstagramFeed();
}
+ofPushMatrix();
+
+ if(ROTATION>0){
+ ofTranslate(540*FACTOR,960*FACTOR);
+ ofRotate(-ROTATION);
+ ofTranslate(-120*FACTOR,-540*FACTOR);
+ }
+
ofPushMatrix(); //Store the coordinate system nexessary for some reason
background.draw(0,0,1080*FACTOR,1920*FACTOR); //ofGetWidth(),ofGetHeight());
ofPopMatrix(); //Restore the coordinate system
@@ -246,7 +254,17 @@ ofPopMatrix(); //Restore the coordinate system
//hence the "primed" mechanism
if (primed){
ofImage img;
- img.grabScreen(0, 0,1080*FACTOR,1920*FACTOR);
+ //float rotation=ofDegToRad(ROTATION);
+ //int width=(1920*FACTOR*sin(rotation))+(1080*FACTOR*cos(rotation));
+ //int height=(1920*FACTOR*cos(rotation))+(1080*FACTOR*sin(rotation));
+ img.grabScreen(0, 0,1920*FACTOR,1920*FACTOR);
+ if(ROTATION>0){
+ img.rotate90(1);
+ img.crop(860*FACTOR,0,1080*FACTOR,1920*FACTOR);
+ }
+ else {
+ img.crop(0,0,1080*FACTOR,1920*FACTOR);
+ }
img.save(SCREENGRABFILEPATH);
primed=false;
}
@@ -256,7 +274,7 @@ ofPopMatrix(); //Restore the coordinate system
isGrabbed=true;
}
-
+ofPopMatrix();
}