Quartz2D

Core Animation

 * http://cocoawithlove.com/2009/03/asteroids-style-game-in-coreanimation_08.html

Gradients
UIView *view = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 100)] autorelease]; CAGradientLayer *gradient = [CAGradientLayer layer]; gradient.frame = view.bounds; gradient.colors = [NSArray arrayWithObjects:(id)[[UIColor blackColor] CGColor], (id)[[UIColor whiteColor] CGColor], nil]; [view.layer insertSublayer:gradient atIndex:0]; - (void)drawRect:(CGRect)rect {    CGContextRef currentContext = UIGraphicsGetCurrentContext;
 * http://www.iphonedevsdk.com/forum/iphone-sdk-development/40744-drawing-rounded-gradient-views.html
 * http://stackoverflow.com/questions/227005/manually-drawing-a-gradient-in-iphone-apps http://developer.apple.com/library/ios/#documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/Introduction/Introduction.html
 * http://stackoverflow.com/questions/422066/gradients-on-uiview-and-uilabels-on-iphone

CGGradientRef glossGradient; CGColorSpaceRef rgbColorspace; size_t num_locations = 2; CGFloat locations[2] = { 0.0, 1.0 }; CGFloat components[8] = { 1.0, 1.0, 1.0, 0.35, // Start color 1.0, 1.0, 1.0, 0.06 }; // End color

rgbColorspace = CGColorSpaceCreateDeviceRGB; glossGradient = CGGradientCreateWithColorComponents(rgbColorspace, components, locations, num_locations);

CGRect currentBounds = self.bounds; CGPoint topCenter = CGPointMake(CGRectGetMidX(currentBounds), 0.0f); CGPoint midCenter = CGPointMake(CGRectGetMidX(currentBounds), CGRectGetMidY(currentBounds)); CGContextDrawLinearGradient(currentContext, glossGradient, topCenter, midCenter, 0);

CGGradientRelease(glossGradient); CGColorSpaceRelease(rgbColorspace); } CGContextSaveGState(context); CGContextAddRect(context, CGRectMake(x, y, width, height)); CGContextClip(context); CGContextDrawLinearGradient (context, gradient, startPoint, endPoint, 0); CGContextRestoreGState(context); You can use Core Animation layers. You can use a CAShaperLayer for your line by settings its path property and then you can use a CAGradientLayer as a layer mask to your shape layer that will cause the line to fade.
 * http://stackoverflow.com/questions/1303855/how-to-draw-a-gradient-line-fading-in-out-with-core-graphics-iphone

Replace your CGContext... calls with calls to CGPath... calls to create the line path. Set the path field on the layer using that path. Then in your gradient layer, specify the colors you want to use (probably black to white) and then set the mask on the line layer like this:

[lineLayer setMask:gradientLayer]; What's cool about the gradient layer is that is allows you to specify a list of locations where the gradient will stop, so you can fade in and fade out. It only supports linear gradients, but it sounds like that may fit your needs.

Let me know if you need clarification.

EDIT: Now that I think of it, just create a single CAGradientLayer that is the width/height of the line you desire. Specify the gradient colors (black to white or black to clear color) and the startPoint and endtPoints and it should give you what you need. CGContextRef context = UIGraphicsGetCurrentContext; CGContextSaveGState(context); CGContextTranslateCTM(context, 0.0f, self.bounds.size.height); CGContextScaleCTM(context, 1.0f, -1.0f);
 * http://stackoverflow.com/questions/1266179/how-do-i-add-a-gradient-to-the-text-of-a-uilabel-but-not-the-background/1267638#1267638

CGContextSelectFont(context, "Helvetica", 20.0f, kCGEncodingMacRoman); CGContextSetTextDrawingMode(context, kCGTextClip); CGContextSetTextPosition(context, 0.0f, round(20.0f / 4.0f)); CGContextShowText(context, [self.text UTF8String], strlen([self.text UTF8String]));

CGContextClip(context);

CGGradientRef gradient; CGColorSpaceRef rgbColorspace; size_t num_locations = 2; CGFloat locations[2] = { 0.0, 1.0 }; CGFloat components[8] = { 1.0, 1.0, 1.0, 1.0, // Start color 1.0, 1.0, 1.0, 0.1 }; // End color

rgbColorspace = CGColorSpaceCreateDeviceRGB; gradient = CGGradientCreateWithColorComponents(rgbColorspace, components, locations, num_locations);

CGRect currentBounds = self.bounds; CGPoint topCenter = CGPointMake(CGRectGetMidX(currentBounds), 0.0f); CGPoint midCenter = CGPointMake(CGRectGetMidX(currentBounds), CGRectGetMidY(currentBounds)); CGContextDrawLinearGradient(context, gradient, topCenter, midCenter, 0);

CGGradientRelease(gradient); CGColorSpaceRelease(rgbColorspace);

CGContextRestoreGState(context); UILabel *titleLabel = [[UILabel alloc] init]; NSString *path = [[NSBundle mainBundle] pathForResource:@"pattern.black" ofType:@"png"]; UIImage *image = ; titleLabel.textColor = ; titleLabel.frame = textFrame; titleLabel.shadowColor = [UIColor whiteColor]; titleLabel.shadowOffset = CGSizeMake(0, -1); titleLabel.backgroundColor = [UIColor clearColor]; titleLabel.textAlignment = UITextAlignmentCenter; titleLabel.text = "Hello";
 * http://silverity.livejournal.com/27704.html

Rotations

 * http://stackoverflow.com/questions/670562/can-i-move-the-origin-when-doing-a-rotation-transform-in-quartz-2d-for-the-iphone
 * http://stackoverflow.com/questions/2740317/quartz-2d-get-degrees-of-rotation-from-transform-property
 * http://stackoverflow.com/questions/1756172/quartz-2d-path-rotation
 * http://www.iphonedevsdk.com/forum/iphone-sdk-development/8361-draw-line-quartz-rotate.html
 * http://www.macresearch.org/tutorial-intro-core-animation
 * http://www.quartzcompositions.com/phpBB2/upload/files.php?cat=2

Core Animation
// Rotates the view. CGAffineTransform transform = CGAffineTransformMakeRotation(3.14159/2); self.view.transform = transform;
 * http://developer.apple.com/library/ios/#documentation/GraphicsImaging/Reference/CABasicAnimation_class/Introduction/Introduction.html
 * http://www.adamzucchi.com/blog/?p=24
 * http://stackoverflow.com/questions/518530/rotate-a-uiview-around-its-center-but-several-times
 * http://discussions.apple.com/thread.jspa?threadID=2082707

// Repositions and resizes the view. CGRect contentRect = CGRectMake(-80, 80, 480, 320); self.view.bounds = contentRect; "So don’t add an animation to the layer instead add it to the actions dictionary and then just change the value."
 * http://forums.pragprog.com/forums/57/topics/1392
 * http://cocoadev.com/index.pl?CoreAnimation
 * http://www.mail-archive.com/cocoa-dev@lists.apple.com/msg04588.html
 * http://www.iphonedevsdk.com/forum/iphone-sdk-game-development/37372-cabasicanimation-transform-rotation.html

Snapshot Screen
@interface CapturedPhotoViewController : UIViewController  { UIImageView *captureView;                              //   Image (Screenshot)
 * http://groups.google.com/group/iphonesdkdevelopment/browse_thread/thread/6105108ae9fb1548?hl=en

<<< on file.m >>> -(IBAction)capturaScreenButton:(id)sender {      UIAlertView *alert; UIGraphicsBeginImageContext(captureView.frame.size); [self.view.layer renderInContext:UIGraphicsGetCurrentContext]; UIImage *image = UIGraphicsGetImageFromCurrentImageContext; UIGraphicsEndImageContext; UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil);

alert = [[UIAlertView alloc] initWithTitle:@"Image captured by Me"                                      message:@"The image is in your Photo Album... congrats dude"                                       delegate:self cancelButtonTitle:@"Ok"                                       otherButtonTitles:nil];       [alert show];       [alert release]; }