590Adding an UIAlertView
Unlike other UIViews, UIAlertView does not need to be added to another view via addSubView.
[myAlertView show] takes care of that.
Trivial, maybe. But I wasn’t aware of it.
UIImageView *v = [[UIImageView alloc] initWithFrame:CGRectMake(0.0, 0.0, 480, 320)];
v.center = CGPointMake(160.0, 240.0);
v.transform = CGAffineTransformMakeRotation(M_PI/2); // radian!
- (void)drawRect:(CGRect)rect {
// Drawing code
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetRGBFillColor(context, 0.0, 0.0, 1.0, 1.0);
CGContextFillEllipseInRect(context, rect);
}
Solution
In the ViewController, which call the drawing class, add
myDrawingClass.opaque = NO;
– or even nicer. In the drawing class’ init function:
self.opaque = NO;
After carefully considering the issue, Apple is now allowing applications to use the function UIGetScreenImage() to programmatically capture the current screen contents. The function prototype is as follows:https://devforums.apple.com/message/149553CGImageRef UIGetScreenImage(void);
UIGraphicsGetImageFromCurrentImageContext();
http://icodeblog.com/2009/07/27/1188/
http://www.elrepositorio.com/?p=31