I have some image, and i wish to draw it in my UIControl. But for increasing performance i need to draw in graphic context.
Now i can use something like that:
var imageRect1 = CGRectMake(0, 0, width, height)
var imageRect2 = CGRectMake(x2, y2, width, height)
...
CGContextDrawImage(ctx, imageRect1, image)
CGContextDrawImage(ctx, imageRect2, image)
...
But this solution means that we at least read image
every time that call that context function.
I search some solution that would work with some steps, like next one (feel free to correct me if I am wrong):
//read image into some bitmap or maybe some byte array
//paste it several times in different places (several times means ~500 times)
Maybe I have to copy pixel by pixel? Can someone give me some advice how to do it fast?