MonoTouch中CGImageCreateWithImageInRect的等价物是什么?

时间:2011-09-20 14:41:43

标签: c# objective-c ios xamarin.ios core-graphics

MonoTouch中CGImageCreateWithImageInRect iOS方法的等价物是什么?

我正在尝试在C#中转换这个Objective-C行:

CGImageRef sampleImageRef = CGImageCreateWithImageInRect(self.CGImage, fillRect);

提前致谢!

1 个答案:

答案 0 :(得分:11)

CoreGrapphics函数 CGImageCreateWithImageInRect 对应 CGImage WithImageInRect 方法。 API签名是:

public CGImage WithImageInRect (RectangleF rect)

从ObjectiveC翻译后,您的源代码应如下所示:

 CGImage sampleImageRef = this.CGImage.WithImageInRect (fillRect);