project_files/HedgewarsMobile/Classes/UIImageExtra.m
changeset 3910 dd47efbdec46
parent 3903 db01c37494af
child 3948 24daa33a3114
--- a/project_files/HedgewarsMobile/Classes/UIImageExtra.m	Sun Sep 26 16:28:04 2010 -0400
+++ b/project_files/HedgewarsMobile/Classes/UIImageExtra.m	Sun Sep 26 23:48:03 2010 +0200
@@ -220,4 +220,19 @@
     return result;
 }
 
++(UIImage *)whiteImage:(CGSize) ofSize {
+    // white rounded rectangle as background image for previewButton
+    UIGraphicsBeginImageContext(ofSize);
+    CGContextRef context = UIGraphicsGetCurrentContext();
+    UIGraphicsPushContext(context);
+
+    CGContextSetRGBFillColor(context, 1.0, 1.0, 1.0, 1.0);
+    CGContextFillRect(context,CGRectMake(0,0,ofSize.width,ofSize.height));
+
+    UIGraphicsPopContext();
+    UIImage *bkgImg = UIGraphicsGetImageFromCurrentImageContext();
+    UIGraphicsEndImageContext();
+    return bkgImg;
+}
+
 @end