Я пытаюсь выяснить способ добавления или добавления пути (который я уже сделал) и каким-то образом установить местоположение места, где будет рисоваться путь.Позиционирование Предварительно сделанный CGPath Inside CGContext
Вот пример того, что я говорю о:
//everything here can be compiled in a regular UIViewController
//this example is very trivial but it illustrates basically what I want to do
CGRect preMadeRect = CGRectMake(0.0f, 0.f, 50.f, 50.f);
CGPathRef preMadePath = CGPathCreateWithEllipseInRect(preMadeRect, NULL);
UIGraphicsBeginImageContext(self.view.frame.size);
CGContextRef context = UIGraphicsGetCurrentContext();
//I thought that maybe if I moved to a new point
//the path would respect the starting point as its new
//x and y coordinates
CGContextMoveToPoint(context, 50.f, 50.f);
//I am adding a path
//I want the path to be positioned at new coordinates
//within the context
CGContextAddPath(context, preMadePath);
CGContextStrokePath(context);
UIImage *resultImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIImageView *imageView = [[UIImageView alloc]initWithImage:resultImage];
[self.view addSubview: imageView];
Любые идеи будут оценены.
CGContextTranslateCTM был всего лишь билетом. Спасибо! – daveMac
Bonus Fun Fact: Если вы когда-либо начинаете работать с 3D-графикой (например, OpenGL), то преобразование системы координат - это то, как вы выполняете почти все. – benzado