0

我创建了一个视图大小的位图。当视图增加高度时,我怎样才能增加这个位图的高度并像这样绘制它:

- (void)drawRect:(CGRect)rect
{
  CGContextRef context = UIGraphicsGetCurrentContext();

  CGContextSaveGState(context);

  if (myBitmapContext)
  {
     CGImageRef imageref = CGBitmapContextCreateImage(myBitmapContext);
     CGContextDrawImage(context, rect, imageref);
     CGImageRelease(imageref);
  }

  CGContextRestoreGState(context);
}

谢谢您的帮助!!

4

1 回答 1

0

您可以CGContextScaleCTM在绘制图像之前使用

于 2013-07-03T06:29:16.403 回答