Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the equivalent of CGImageCreateWithImageInRect in MonoTouch?

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!

like image 866
Emanuele Sabetta Avatar asked Sep 20 '11 14:09

Emanuele Sabetta


1 Answers

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);
like image 84
poupou Avatar answered Sep 18 '22 01:09

poupou



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!