How to display the UIImageJPEGRepresentation image in iphone sdk

Madan Mohan picture Madan Mohan · Oct 14, 2010 · Viewed 14.5k times · Source

I want to use UIImageJPEGRepresentation to add the image in iphone, in below code i am missing some thing I don't know how to add

NSData *data=[NSData dataWithContentsOfURL:[NSURL URLWithString:gameObj.gameThumbnails]];   
UIImage *myImage=[UIImage imageWithData:data];

imageView.image=UIImageJPEGRepresentation(myImage, 90);// I am missing something here
[elementView addSubview:imageView];
[imageView release];  

 /*gameObj.gameThumbnails is an url like http://static.gamesradar.com/images/mb/GamesRadar/us/Games/X/X-Men%20Arcade/Bulk%20Viewer/360%20PS3/2010-10-11/192.168.30.167-image36_bmp_jpgcopy--game_thumbnail.jpg
*/

Please help me out of this

Answer

iOSPawan picture iOSPawan · Oct 14, 2010

u are setting comparison quality to 90. it should be between 0.0 to 1.0