Last active
January 23, 2016 11:51
-
-
Save kidapu/6b4e68df498e66de8f3e to your computer and use it in GitHub Desktop.
てきとーな画像グリッジ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://www.instagram.com/p/BA4WOQ2MtnT/ | |
#pragma once | |
#include "ofMain.h" | |
class ofApp : public ofBaseApp | |
{ | |
public: | |
ofImage img; | |
void setup() | |
{ | |
img.load("Octocat.png"); | |
} | |
void update() | |
{ | |
if( ofRandom(10) < 2 ) | |
{ | |
img.load("Octocat.png"); | |
} | |
else | |
{ | |
img.crop(ofRandom(20), ofRandom(20), 800, 665); | |
} | |
img.update(); | |
} | |
void draw() | |
{ | |
img.draw(0,0); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment