1. 由于CoreGraphics 的坐标系与手机屏幕坐标系的Y轴是相反的, 所以在我们开发的时候, 需要翻转坐标系;

- (void)drawRect:(CGRect)rect
{
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextTranslateCTM(context, 0, self.height);
    CGContextTranslateCTM(context, 1.0f, -1.0f);
    [self.viewToMagnify.layer renderInContext:context];
}

 

相关文章:

  • 2021-11-04
  • 2021-07-17
  • 2021-06-24
  • 2022-12-23
  • 2021-08-28
  • 2022-12-23
  • 2021-08-21
  • 2021-05-26
猜你喜欢
  • 2021-09-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-28
  • 2022-12-23
  • 2021-12-13
相关资源
相似解决方案