Skip to content

Instantly share code, notes, and snippets.

@jeksys
Created June 27, 2011 20:33
Show Gist options
  • Save jeksys/1049759 to your computer and use it in GitHub Desktop.
Save jeksys/1049759 to your computer and use it in GitHub Desktop.
drawRect
- (void)drawRect:(CGRect)rect
{
CGContextRef context = UIGraphicsGetCurrentContext(); // get current context
// CGFloat object_size = sizeStatus/2;
// CGFloat sx, sy, fsize = object_size;
// sx = rect.size.width - fsize;
// sy = fsize;
// CGContextMoveToPoint(context, sx, sy);
// CGContextSetLineWidth(context, 2.0);
// CGContextSetRGBFillColor(context, 1.0, 0, 0, 1.0);
// CGContextFillEllipseInRect(context, CGRectMake(sx, sy, fsize, fsize));
//
// sx = sx + fsize/4;
// sy = sy - fsize/2;
// CGContextMoveToPoint(context, sx, sy);
// CGContextSetRGBStrokeColor(context, 1.0, 0.0, 0.0, 1.0);
// CGContextAddEllipseInRect(context, CGRectMake(sx, sy, fsize/2, fsize));
// CGImageRef imageRef = [self.asset thumbnail];
CGContextTranslateCTM(context, 0, rect.size.height);
CGContextScaleCTM(context, 1.0, -1.0);
CGContextDrawImage(context, rect, [self.asset thumbnail]);
CGContextDrawImage(context, CGRectMake(size - sizeStatus, size - sizeStatus, sizeStatus, sizeStatus), [[DataManager sharedManager] cgLock]);
CGContextStrokePath(context);
// CGContextSaveGState(context);
// CGContextTranslateCTM(context, 10,10);
// CGContextRotateCTM(context, M_PI_4);
// CGContextRestoreGState(context);
// UIGraphicsEndImageContext();
// CGContextMoveToPoint(context, 0, 0);
// CGContextAddLineToPoint(context, rect.size.width, rect.size.height);
// TODO
// draw an image
// draw all the taggs
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment