c# - MonoTouch 中 CGImageCreateWithImageInRect 的等价物是什么?

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

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

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

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

提前致谢!

最佳答案

CoreGraphics 函数CGImageCreateWithImageInRect 对应于CGImageWithImageInRect 方法。 API 签名是:

public CGImage WithImageInRect (RectangleF rect)

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

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

关于c# - MonoTouch 中 CGImageCreateWithImageInRect 的等价物是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7487067/

相关文章:

c# - 在 C# 中调用时执行 Double & Float 方法参数

c# - 检测更新版本的逻辑

c# - 在第二个表格关闭时制作一个事件

c# - 使用 MVCSiteMapPath 的样式化面包屑导航

objective-c - 如何使用每 N 秒更改 NSString 的值?

ios - 将 Realm 添加到 watchkit 项目时出现 Mach-O header 错误

ios - ABRecordGetRecordID 返回 -1

iOS Storyboard AutoLayout 如何将 UIView 放置在 3. 5"and 4"屏幕的底部?

objective-c - 一个UIButton两个场景只有一个segue,需要条件代码

iOS UITableView 防止滚动