I want to draw UIImage for pattern background and I need need it be float size. For example: I need 7.0699929299999997 width and height.
My code:
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();
But as result my image:
po resizedImage
<UIImage: 0x6000014b21e0> size {8, 8} orientation 0 scale 1.000000
Help me out please
UIImage
s resolution is in pixels. You can't have a size that isn't an Integer, even if you provide aCGFloat
in theCGSizeMake
it'll be converted to an Integer later. – TawaNicolas