UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(50, 50, 100, 100)];
imageView.image = [UIImage imageNamed:@"11"];
//png格式
NSData *imagedata=UIImagePNGRepresentation(imageView.image);
//JEPG格式
//NSData *imagedata=UIImageJEPGRepresentation(m_imgFore,1.0);
NSArray*paths=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES);
NSString *documentsDirectory=[paths objectAtIndex:0];
NSString *savedImagePath=[documentsDirectory stringByAppendingPathComponent:@"11.png"];
[imagedata writeToFile:savedImagePath atomically:YES];