image export xcode/iphone

Discussion in 'iOS Programming' started by KardelSharpeye, May 1, 2009.

  1. macrumors member


    Apr 28, 2009
    does anyone know how to save or export an image to file on iphone after using the camera to take the picture?
  2. macrumors regular

    Apr 9, 2009
    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 ^^
  3. thread starter macrumors member


    Apr 28, 2009
    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.
  4. macrumors newbie

    May 10, 2009
    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:mad:"savedImage.png"];
    UIImage *image = imageView.image; // imageView is my image from camera
    NSData *imageData = UIImagePNGRepresentation(image);
    [imageData writeToFile:savedImagePath atomically:NO];
  5. thread starter macrumors member


    Apr 28, 2009
  6. macrumors newbie

    Oct 27, 2010
    can u give me the path where the image is saved

Share This Page