Can I get the pixel size for a UIImage if I just multiply the image.size with the image.scale ? Is it the same as doing this:
guard let cgImage = image.CGImage else{
return nil
}
let width = CGImageGetWidth(cgImage)
let height = CGImageGetHeight(cgImage)
Yes.
CGImageGetWidth
and CGImageGetHeight
will return the same size (in pixels) as returned by image.size * image.scale
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With