Skip to content

Instantly share code, notes, and snippets.

@tolmasky
Created October 26, 2009 07:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tolmasky/218468 to your computer and use it in GitHub Desktop.
Save tolmasky/218468 to your computer and use it in GitHub Desktop.
CGContextRef context = [[NSGraphicsContext currentContext] graphicsPort];
CGRect bounds = CGRectInset(*(CGRect *)&aRect, OUTlINE_HORIZONTAL_INSET - 0.5, OUTlINE_VERTICAL_INSET - 0.5);
CGColorRef shadowColor = CGColorCreateGenericGray(0.0, 0.5);
CGContextSetShadowWithColor (context, CGSizeMake(0.0, -10.0), 30.0, shadowColor);
CGColorRelease(shadowColor);
CGColorRef fillColor = CGColorCreateGenericGray(1.0, 1.0);
CGColorRef strokeColor = CGColorCreateGenericGray(0.0, 0.2);
CGContextSetFillColorWithColor(context, fillColor);
CGContextSetStrokeColorWithColor(context, strokeColor);
CGColorRelease(fillColor);
CGColorRelease(strokeColor);
CGContextBeginPath(context);
CGContextAddArc(context, CGRectGetMinX(bounds) + 3.0, CGRectGetMaxY(bounds) - 3.0, 2.0, M_PI, M_PI_2, YES);
CGContextAddArc(context, CGRectGetMaxX(bounds) - 3.0, CGRectGetMaxY(bounds) - 3.0, 2.0, M_PI_2, 0, YES);
CGContextAddArc(context, CGRectGetMaxX(bounds) - 3.0, CGRectGetMinY(bounds) + 3.0, 2.0, 0, 3 * M_PI_2, YES);
CGContextAddArc(context, CGRectGetMinX(bounds) + 3.0, CGRectGetMinY(bounds) + 3.0, 2.0, 3 * M_PI_2, M_PI, YES);
CGContextClosePath(context);
CGContextDrawPath(context, kCGPathFill);//Stroke);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment