What is the equivalent of CGImageCreateWithImageInRect in MonoTouch?

我与影子孤独终老i 提交于 2021-02-05 03:54:21

问题


What is the equivalent of CGImageCreateWithImageInRect iOS method in MonoTouch?

I'm trying to convert this Objective-C line in C#:

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

Thanks in advance!


回答1:


The CoreGrapphics function CGImageCreateWithImageInRect correspond to the WithImageInRect method of CGImage. API signature is:

public CGImage WithImageInRect (RectangleF rect)

Once translated from ObjectiveC your source code should look like:

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


来源:https://stackoverflow.com/questions/7487067/what-is-the-equivalent-of-cgimagecreatewithimageinrect-in-monotouch

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!