CGImageCreateWithImageInRect

CGImageCreateWithImageInRect

MonoTouch中的CGImageCreateWithImageInRect iOS方法等效于什么?

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

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

提前致谢!

最佳答案

CoreGrapphics函数 CGImageCreateWithImageInRect 对应于 CGImage WithWithImageInRect 方法。 API签名为:

public CGImage WithImageInRect (RectangleF rect)

从ObjectiveC转换后,您的源代码应如下所示:
 CGImage sampleImageRef = this.CGImage.WithImageInRect (fillRect);

10-08 12:50