Created
March 24, 2016 16:11
-
-
Save mrpossoms/bcbc56c320251200f8e5 to your computer and use it in GitHub Desktop.
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
CGDataProviderRef provider = CGDataProviderCreateWithData(NULL, | |
snap->data, | |
snap->current.width * snap->current.height * 4, | |
NULL); | |
CGColorSpaceRef colorSpaceRef = CGColorSpaceCreateDeviceRGB(); | |
CGBitmapInfo bitmapInfo = kCGBitmapByteOrderDefault; | |
CGColorRenderingIntent renderingIntent = kCGRenderingIntentDefault; | |
CGImageRef imageRef = CGImageCreate(snap->current.width, | |
snap->current.height, | |
8, | |
32, | |
4 * snap->current.width,colorSpaceRef, | |
bitmapInfo, | |
provider,NULL,NO,renderingIntent); | |
/*I get the current dimensions displayed here */ | |
UIImage *newImage = [UIImage imageWithCGImage:imageRef]; | |
NSLog(@"%@", newImage); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment