iphone相框应用程序

时间:2010-09-02 09:39:35

标签: iphone photo

我正在创建相框应用程序如何在一个单独的png中合并照片和框架并将其保存到软件包或文档文件夹中。

1 个答案:

答案 0 :(得分:1)

//UIGraphicsBeginImageContext(im1.frame.size);
UIGraphicsBeginImageContext(im2.frame.size);

[im1.image drawInRect:CGRectMake(0.0, 0.0, im2.frame.size.width, im2.frame.size.height)];
[backdrop.layer renderInContext:UIGraphicsGetCurrentContext()];
[im2.image drawInRect:CGRectMake(0.0, 0.0, im2.frame.size.width, im2.frame.size.height) blendMode:kCGBlendModeNormal alpha:1.0];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
//NSData *dataObj = UIImagePNGRepresentation(image);
//NSString *picturedata = [dataObj base64Encoding];
appDelegate.fbpost=image;

//appDelegate.image11=image;

[UIImagePNGRepresentation(image) writeToFile:[self findUniqueSavePath] atomically:YES];

// Set the background
//SETIMAGE(image);

// Show the current contents of the documents folder
CFShow([[NSFileManager defaultManager] directoryContentsAtPath:[NSHomeDirectory() stringByAppendingString:@"/Documents"]]);