Sunday, September 29, 2013

iphone camera development issues

iphone development, on-device debugging, call the real machine camera, camera, how to set the photo looks too have names such as "1111.jpg", and looks after the photos are always covered by a previous picture?
Reply:
Resolved

Code
/ / Save the image to the sandbox
NSArray * paths = NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, YES);
NSString * filePath = [[paths objectAtIndex: 0] stringByAppendingPathComponent: [NSString stringWithFormat: @ "1111.jpg"]] ;/ / save file name
BOOL result;
result = [UIImagePNGRepresentation (images) writeToFile: filePath atomically: YES]; / / returns YES successfully saved

No comments:

Post a Comment