image export xcode/iphone

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

  1. macrumors member

    KardelSharpeye

    Joined:
    Apr 28, 2009
    #1
    hello,
    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

    Joined:
    Apr 9, 2009
    #2
    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

    KardelSharpeye

    Joined:
    Apr 28, 2009
    #3
    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

    Joined:
    May 10, 2009
    #4
    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

    KardelSharpeye

    Joined:
    Apr 28, 2009
  6. macrumors newbie

    Joined:
    Oct 27, 2010
    #6
    can u give me the path where the image is saved
     

Share This Page