iPhone - 我怎样才能获得uiimage的高度和宽度 [英] iphone - how can i get the height and width of uiimage

查看:148
本文介绍了iPhone - 我怎样才能获得uiimage的高度和宽度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从网址图片中邮件

我正在将图片添加到邮件视图中。它将显示完整的图像。但我想计算,按比例改变图像的高度和宽度。

I'm adding image to mail view. It will show full image. But I want to calculate, proportionally change the height and width of the image.

如何获得 UIImage的高度和宽度

推荐答案

let heightInPoints = image.size.height
let heightInPixels = heightInPoints * image.scale

let widthInPoints = image.size.width
let widthInPixels = widthInPoints * image.scale

这篇关于iPhone - 我怎样才能获得uiimage的高度和宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆