PDA

View Full Version : image export xcode/iphone




KardelSharpeye
May 1, 2009, 05:31 PM
hello,
does anyone know how to save or export an image to file on iphone after using the camera to take the picture?



BlackWolf
May 2, 2009, 04:31 AM
hello,
does anyone know how to save or export an image to file on iphone after using the camera to take the picture?

I'm not quite sure what you mean.
Do you mean how to do that programatically? I think that is done automatically - the image is saved to your camera roll.

Or do you mean in general (in that case this is the wrong forum). If so, simply connect the iphone to your pc and it will be recognized as a camera ^^

KardelSharpeye
May 5, 2009, 10:32 AM
hi BlackWolf,
i was just wondering if i can make a simple program in iPhone that would take a picture using the iphone and then i add smaller images(jpg) files on top of it and save it to a new jpg file...i am not sure how this is done...but i see something like UIImageRepresentation for PNG or JPEG. any advice will greatly be appreciated.

mcgrath3
May 10, 2009, 12:03 PM
hi BlackWolf,
i was just wondering if i can make a simple program in iPhone that would take a picture using the iphone and then i add smaller images(jpg) files on top of it and save it to a new jpg file...i am not sure how this is done...but i see something like UIImageRepresentation for PNG or JPEG. any advice will greatly be appreciated.

This might help:
//You need to have imageview set up as the image returned from the camera first before doing this;
- (IBAction)saveImage {
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *savedImagePath = [documentsDirectory stringByAppendingPathComponent:@"savedImage.png"];
UIImage *image = imageView.image; // imageView is my image from camera
NSData *imageData = UIImagePNGRepresentation(image);
[imageData writeToFile:savedImagePath atomically:NO];
}

KardelSharpeye
May 11, 2009, 11:50 AM
cool i think that works.

mubashir441
Oct 28, 2010, 12:33 AM
can u give me the path where the image is saved