Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Most efficent way to create a CALayer with an image in it?

I am wondering what the most efficient way is to make a CALayer with an image in it.

I know you can load a UIImage and then call [image CGImage] but is this the best way of going about it? As far as I can tell from Apple's documentation this is the only way you can do it.

like image 853
Michael Gaylord Avatar asked Jun 14 '09 10:06

Michael Gaylord


1 Answers

Try this:

layer.contents = (__bridge id)[ uiimage CGImage ] ;

HTH

like image 189
nielsbot Avatar answered Oct 10 '22 23:10

nielsbot