privateson
asked on
How to Create UIImage from NSData and Avatar Data of XMPP?
Hi, This question is related to Iphone SDK, NSData and UIImage.
I am trying to create an image from the Avatar Data returned from the xmpp like the following: Away due to idle.0awaya3f549fa9705e7ea
So in this case, I assume that a3f549fa9705e7ead2905de0b6
I think if I can get the NSData object, I can easily create the UIImage, right?
You can check this nice article:
Convert an NSImage to CIImage
http://theocacao.com/document.page/350/
Few comments under the article are interesting too.
Convert an NSImage to CIImage
http://theocacao.com/document.page/350/
Few comments under the article are interesting too.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
NSData is a class allowing to store raw data. It is useful if your app is downloading a file. Or if you need to save a data on disk.
This way works fine:
NSString *file = @"/Library/Test/test.png";
NSImage* image = [[NSImage alloc] initWithContentOfFile:file
NSData* data = [image TIFFRepresentation];
[image release];
Opposite is a bit problem. At least you need to know the format of the data.