2011-09-20 65 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

相關問題