Tyler Wall
Tyler Wall

Reputation: 3788

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... :)

Upvotes: 47

Views: 39643

Answers (3)

Jason Coco
Jason Coco

Reputation: 78343

CGImageRef cgImage = [someImage CGImage];

Upvotes: 17

Satish Azad
Satish Azad

Reputation: 2312

write folowing to get CGImage from UIImage: Suppose u have an UIImage object ex imageObject then,

CGImage imageRef = imageObject.CGImage

Upvotes: 3

Deepak Danduprolu
Deepak Danduprolu

Reputation: 44633

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

Upvotes: 111

Related Questions