uiにUIImageが入ってるとして
UIImage *ui = [UIImage imageNamed:@"cat"];
UIImage -> CGImage
struct CGImage *cg = [ui CGImage];
CGImage -> UIImage
UIImage *ui = [UIImage imageWithCGImage:cg];
UIImage -> CIImage
CIImage *ci = [ui CIImage];
CIImage -> UIImage
UIImage *ui = [UIImage imageWithCIImage:ci];
CGImage -> CIImage
CIImage *ci = [CIImage imageWithCGImage:cg];
CIImage -> CGImage
CIContext *context = [CIContext contextWithOptions:nil];
struct CGImage *cg = [context createCGImage:ci fromRect:ci.extent];
UIImage -> NSData
NSData *da = UIImageJPEGRepresentation(ui, 1.0); //JPEGとして
NSData *da = UIImagePNGRepresentation(ui); //PNGとして
NSData -> UIImage
UIImage *ui = [UIImage imageWithData:da];
0 件のコメント:
コメントを投稿