Skip to content

Instantly share code, notes, and snippets.

@Nub
Created October 5, 2011 02:59
Show Gist options
  • Select an option

  • Save Nub/1263514 to your computer and use it in GitHub Desktop.

Select an option

Save Nub/1263514 to your computer and use it in GitHub Desktop.
NSString * path = [[NSBundle mainBundle] pathForResource:@"filename" ofType:@"jpg"];
UIImage * img = [[UIImage alloc]initWithContentsOfFile:path];
CGImageRef image = [img CGImage];
CFDataRef data = CGDataProviderCopyData(CGImageGetDataProvider(image));
const unsigned char * buffer = CFDataGetBytePtr(data);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment