Skip to content

Instantly share code, notes, and snippets.

@kidapu
Last active January 23, 2016 11:51
Show Gist options
  • Save kidapu/6b4e68df498e66de8f3e to your computer and use it in GitHub Desktop.
Save kidapu/6b4e68df498e66de8f3e to your computer and use it in GitHub Desktop.
てきとーな画像グリッジ
// 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