NSData *imageData = UIImagePNGRepresentation(your_image_here);
After that i transferred it to another iPhone using bluetooth. Now i need to convert the data back to image. Can any one tell me how to do it?
I assume this is to et back the data which you encoded in the previous question.
For converting UIImage to NSData ,
NSData* pictureData = UIImagePNGRepresentation(image);
To get it back,
UIImage *image = [[UIImage alloc]initWithData:pictureData];
Remember to add [image release] at the end.
or you can use
UIImage *image = [[UIImage alloc]init];
[image imageWithData:pictureData];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With