can anyone tell me how to convert an image(PNG) to data in iphone
+3
A:
NSData* pictureData = UIImagePNGRepresentation(image);
here image is an UIImage object
Nithin
2009-12-08 05:14:02
A:
If you want to getdata from image from bundle then its similar just you specify the path for it. Below is the code to get data from your PNG image by this way.
NSString *path = [[NSBundle mainBundle] pathForResource:@"image" ofType:@"png"];
NSData *myData = [NSData dataWithContentsOfFile:path];
Jay Vachhani
2009-12-08 05:18:57