|
@@ -216,6 +216,20 @@
|
|
|
return [UIImage imageWithCGImage:img.CGImage scale:2.0 orientation: UIImageOrientationDownMirrored];
|
|
|
}
|
|
|
|
|
|
++ (UIImage *)changeThemingColorImage:(UIImage *)image width:(CGFloat)width height:(CGFloat)height color:(UIColor *)color
|
|
|
+{
|
|
|
+ CGRect rect = CGRectMake(0, 0, width, height);
|
|
|
+ UIGraphicsBeginImageContext(rect.size);
|
|
|
+ CGContextRef context = UIGraphicsGetCurrentContext();
|
|
|
+ CGContextClipToMask(context, rect, image.CGImage);
|
|
|
+ CGContextSetFillColorWithColor(context, [color CGColor]);
|
|
|
+ CGContextFillRect(context, rect);
|
|
|
+ UIImage *img = UIGraphicsGetImageFromCurrentImageContext();
|
|
|
+ UIGraphicsEndImageContext();
|
|
|
+
|
|
|
+ return [UIImage imageWithCGImage:img.CGImage scale:1.0 orientation: UIImageOrientationDownMirrored];
|
|
|
+}
|
|
|
+
|
|
|
+ (UIImage*)drawText:(NSString*)text inImage:(UIImage*)image colorText:(UIColor *)colorText sizeOfFont:(CGFloat)sizeOfFont
|
|
|
{
|
|
|
NSDictionary* attributes = @{NSFontAttributeName: [UIFont systemFontOfSize:sizeOfFont], NSForegroundColorAttributeName:colorText};
|