Created
December 9, 2012 14:19
-
-
Save ofTheo/4245137 to your computer and use it in GitHub Desktop.
OF iOS image picker from library example
This file contains hidden or 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
#include "testApp.h" | |
ofxiPhoneImagePicker camera; | |
ofImage photo; | |
//-------------------------------------------------------------- | |
void testApp::setup(){ | |
ofBackground(0); | |
} | |
//-------------------------------------------------------------- | |
void testApp::update(){ | |
if(camera.imageUpdated){ | |
photo.setFromPixels(camera.pixels, camera.width, camera.height, OF_IMAGE_COLOR_ALPHA); | |
camera.imageUpdated = false; | |
camera.close(); | |
} | |
} | |
//-------------------------------------------------------------- | |
void testApp::draw(){ | |
ofDrawBitmapString("touch the screen to open the library", 10, 20); | |
photo.draw(0,0); | |
} | |
//-------------------------------------------------------------- | |
void testApp::exit() { | |
} | |
//-------------------------------------------------------------- | |
void testApp::touchDown(ofTouchEventArgs & touch){ | |
if(touch.id == 0){ | |
camera.openLibrary(); | |
} | |
} | |
//-------------------------------------------------------------- | |
void testApp::touchMoved(ofTouchEventArgs & touch){ | |
} | |
//-------------------------------------------------------------- | |
void testApp::touchUp(ofTouchEventArgs & touch){ | |
} | |
//-------------------------------------------------------------- | |
void testApp::touchDoubleTap(ofTouchEventArgs & touch){ | |
} | |
//-------------------------------------------------------------- | |
void testApp::touchCancelled(ofTouchEventArgs & touch){ | |
} | |
//-------------------------------------------------------------- | |
void testApp::lostFocus() { | |
} | |
//-------------------------------------------------------------- | |
void testApp::gotFocus() { | |
} | |
//-------------------------------------------------------------- | |
void testApp::gotMemoryWarning() { | |
} | |
//-------------------------------------------------------------- | |
void testApp::deviceOrientationChanged(int newOrientation){ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment