2011-09-20 56 views

回答

11

的CoreGrapphics起作用CGImageCreateWithImageInRect对应于WithImageInRect方法CGImage。 API签名是:

public CGImage WithImageInRect (RectangleF rect) 

从的ObjectiveC一旦翻译你的源代码应该是这样的:

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

他们实际上并不相互一致。 CreateWithImageInRect考虑rect的位置,而WithImageInRect(单声道版本)仅考虑rect的大小。 https://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CGImage/#//apple_ref/c/func/CGImageCreateWithImageInRect – Gandalf458

相关问题