From be69cedbbfe60d9d306836b37e1f6f255bdfc5da Mon Sep 17 00:00:00 2001 From: arichornlover <78001398+arichornlover@users.noreply.github.com> Date: Mon, 13 May 2024 20:33:50 -0500 Subject: [PATCH] Update RootOptionsController.m --- Sources/RootOptionsController.m | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Sources/RootOptionsController.m b/Sources/RootOptionsController.m index 476668f..d8922ac 100644 --- a/Sources/RootOptionsController.m +++ b/Sources/RootOptionsController.m @@ -178,6 +178,15 @@ @implementation RootOptionsController (Privates) +- (UIImage *)resizeImage:(UIImage *)image toSize:(CGSize)size { + UIGraphicsBeginImageContextWithOptions(size, NO, [UIScreen mainScreen].scale); + [image drawInRect:CGRectMake(0, 0, size.width, size.height)]; + UIImage *resizedImage = UIGraphicsGetImageFromCurrentImageContext(); + UIGraphicsEndImageContext(); + + return resizedImage; +} + - (UIImage *)resizeImage:(UIImage *)image newSize:(CGSize)newSize { UIGraphicsBeginImageContextWithOptions(newSize, NO, [UIScreen mainScreen].scale); [image drawInRect:CGRectMake(0, 0, newSize.width, newSize.height)];