How to save the draws made to the photo library?


#1

Hello

Anyone can explain how to add a button that save the draws that you did with this app?
i mean the button part i know how to do… i just can’t understand how to save the view

i’m writing something like this on my appdelegate.m [code]-(UIImage *) ChangeViewToImage : (UIView *) view{

UIGraphicsBeginImageContext(view.bounds.size);
[TouchDrawView renderInContext:UIGraphicsGetCurrentContext()];
UIImage *img = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();

return img;

}

  • (IBAction)guardar:(id)sender{
    NSLog(@“buh”);
    UIGraphicsBeginImageContext(CGSizeMake(320,480));
    UIImage* result = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    UIImageWriteToSavedPhotosAlbum(result, self, nil, nil);

}[/code]

but it’s not working… well the action by it self save a white image… so i missing the part where instead of a white image it save the draw from the uiview

anyone to help?

regards