5

我在 cgcontext 上绘制了一个 uiimage

CGContextDrawImage(tempContext, CGRectMake(0,0,myRect.size.width,myRect.size.height), imgRef);

但是一旦用户完成了当前图像,我想清除 tempContext 以便我可以重新缩放/操作图像并在相同的上下文中重绘它。

为此,我想清除上下文并使其干净。我试过 CgContextClearRect 但它没有用:(

4

1 回答 1

7

试试这个,它对我有用:CGContextClearRect(UIGraphicsGetCurrentContext(), rect);

于 2010-01-28T22:20:09.990 回答