i have done a little of both, the start of my code is this, im trying to find out what i need to do to call this function:
void MyColoredPatternPainting (CGContextRef myContext, CGRect rect)
{
CGPatternRef pattern;
CGColorSpaceRef patternSpace;
float alpha = 1,
width, height;
static const CGPatternCallbacks callbacks = {0, &MyDrawPattern, NULL};
CGContextSaveGState (myContext);
patternSpace = CGColorSpaceCreatePattern (NULL);
CGContextSetFillColorSpace (myContext, patternSpace);
CGColorSpaceRelease (patternSpace);
pattern = CGPatternCreate (NULL,
CGRectMake (0, 0, H_PSIZE, V_PSIZE),
CGAffineTransformMake (1, 0, 0, 1, 0, 0),
H_PATTERN_SIZE,
V_PATTERN_SIZE,
kCGPatternTilingConstantSpacing,
true,
&callbacks);
CGContextSetFillPattern (myContext, pattern, &alpha);
CGPatternRelease (pattern);
CGContextFillRect (myContext, rect);
CGContextRestoreGState (myContext);
}*/