我想为图案背景绘制 UIImage,我需要它是 float 大小。例如: 我需要 7.0699929299999997 的宽度和高度。
我的代码:
UIImage *repeatedImage = [UIImage imageNamed"LayoutRepeatedImage"];
CGSize destinationSize = CGSizeMake(7.0699929299999997, 7.0699929299999997);
UIGraphicsBeginImageContext(destinationSize);
[repeatedImage drawInRect:CGRectMake(0, 0, destinationSize.width, destinationSize.height)];
UIImage *resizedImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
但结果是我的图像:
po resizedImage
<UIImage: 0x6000014b21e0> size {8, 8} orientation 0 scale 1.000000
请帮帮我
您可以在图像中绘制小数,但请记住:
关于ios - 用 float 大小绘制 UIImage,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46971862/
欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://jike.in/) | Powered by Discuz! X3.4 |