MonoTouch中CGImageCreateWithImageInRect iOS方法的等价物是什么?
我正在尝试在C#中转换这个Objective-C行:
CGImageRef sampleImageRef = CGImageCreateWithImageInRect(self.CGImage, fillRect);
提前致谢!
答案 0 :(得分:11)
CoreGrapphics函数 CGImageCreateWithImageInRect 对应 CGImage 的 WithImageInRect 方法。 API签名是:
public CGImage WithImageInRect (RectangleF rect)
从ObjectiveC翻译后,您的源代码应如下所示:
CGImage sampleImageRef = this.CGImage.WithImageInRect (fillRect);