I have a rectangular CPImage setup like so
var img = [[CPImage alloc] initWithContentsOfFile:"Resources/img.jpg""];
I'd like to display that in my CPView subclass in a circle with the part of the image clipped (what lies outside the eclipse) remaining transparent. I tried this:
- (void)drawRect:(CGRect)aRect
{
var path = [CPBezierPath bezierPathWithOvalInRect:aRect];
[[CPColor colorWithPatternImage:img] set];
[path fill];
}
but I just get a black circle.