I am very new in ios programming and here's my problem. I create a path with CGContext (an hexagon) and I want to put an image into this path. Here's the creation path code:
-(void)drawAllShapes:(float)xcoord :(float)ycoord :(float)cote :(CGContextRef)c :(CGFloat *) fillcolor inRect:(CGRect)rect{
xcoord = xcoord*rect.size.width;
ycoord = ycoord*rect.size.height;
cote = cote*rect.size.height;
float x = 0.1835f*rect.size.width;
float y = 0.06162f*rect.size.height;
CGFloat strokecolor[4] = {1.0f, 1.0f, 1.0f, 1.0f};
CGContextSetStrokeColor(c, strokecolor);
CGContextSetFillColor(c, fillcolor);
CGContextSetLineWidth(c, 4.0f);
CGContextBeginPath(c);
CGContextMoveToPoint(c, xcoord, ycoord);
CGContextAddLineToPoint(c, xcoord+x, ycoord+y);
CGContextAddLineToPoint(c, xcoord+x, ycoord+cote+y);
CGContextAddLineToPoint(c, xcoord, ycoord+cote+2*y);
CGContextAddLineToPoint(c, xcoord-x, ycoord+cote+y);
CGContextAddLineToPoint(c, xcoord-x, ycoord+y);
CGContextClosePath(c);
CGContextDrawPath(c, kCGPathFillStroke);
}
Can someone help me please?