Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any difference between CGImageGetWidth(workingImage.CGImage) and workingImage.size.width?

Is there any difference between CGImageGetWidth(workingImage.CGImage) and workingImage.size.width ? Is the first faster or safer? I know that in the second case I get the value directly.

like image 946
Tomasz Szulc Avatar asked Oct 26 '25 22:10

Tomasz Szulc


1 Answers

Actually both of them returns the same result. CGImageGetWidth(Image.CGImage) returns the Bitmap image width, Image.size.width returns the UIImage width. If you ask about safe/fast, i think first one will be faster, because it comes from ApplicationServices framework and the second one is from UIKit framework. Hope this helps you..

like image 95
relower Avatar answered Oct 28 '25 12:10

relower