Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIImage -> CGImageRef

I'm building an Iphone app that needs to convert a UIImage to a CGImageRef. I have no idea how to do this and would love some help. I have no background in working with images... :)

like image 631
Wallter Avatar asked May 20 '11 03:05

Wallter


People also ask

What is a UIImage?

An object that manages image data in your app.

What is Cgimage in Swift?

A bitmap image or image mask.

What is CG image?

Computer-generated imagery (CGI) is the use of computer graphics to create or contribute to images in art, printed media, video games, simulators, computer animation and VFX in films, television programs, shorts, commercials, and videos.

What is use of UIImageView?

Overview. Image views let you efficiently draw any image that can be specified using a UIImage object. For example, you can use the UIImageView class to display the contents of many standard image files, such as JPEG and PNG files.


2 Answers

It is as simple as image.CGImage where image is a UIImage object.

like image 85
Deepak Danduprolu Avatar answered Sep 19 '22 08:09

Deepak Danduprolu


CGImageRef cgImage = [someImage CGImage]; 
like image 28
Jason Coco Avatar answered Sep 19 '22 08:09

Jason Coco