I am having file with extension .RGB and need to display it on uiimageview.
For this i need to convert the .RGB format to specific format like .PNG or .JPEG however unable to get it right .
I tried with following code for this.
UIImage *image=[UIImage imageNamed:@"Attachment.RGB"];
CGImageRef imageRef=[image CGImage];
UIImage *myImage = [UIImage imageWithCGImage:imageRef];
NSData *pngData = UIImagePNGRepresentation(myImage);
UIImage* imageFinal = [UIImage imageWithData:pngData];
image_view.image=imageFinal;
There are online websites which can convert the RGB to visible image .But i didn’t found any solution for objective c .
Can any one help me on this .
Regards
Pagyyy123
You can use the readtex.c for this which is open source implementations for this.. see the sample following code snippets…
http://opensource.apple.com/source/X11server/X11server-85/mesa/Mesa-7.2/progs/util/readtex.c
I hope the above URL will help.