Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在 Objective-C 中获得缩放图像的大小(宽度或高度)?提供示例代码。另外,我尝试了以下方法,但它不起作用,
宽度:self.object.position.x * scaleFactor;
UIImage有一个size属性,一个CGSizewithwidth和height。就是这个尺寸。如果需要像素尺寸,请乘以比例。
UIImage
size
CGSize
width
height
CGFloat imageWidth = myImage.size.width;
NSStringFromCGSize([image size]);