C#
var httpClient = new HttpClient();
var buf = await httpClient.GetByteArrayAsync("https://upload.wikimedia.org/wikipedia/commons/e/e9/Soy-whey-protein-diet.jpg");
UIImage source = UIImage.LoadFromData(NSData.FromArray(buf));
var cropRect = new CGRect(0, 0, 100, 100);
var cropped = source.CGImage.Cropping(cropRect);
Compiles
Does not compile because the CGImage.Cropping method is not exposed to C#
I found it is available as WithImageInRect.
@spouliot Should this be documented?
It mirrors the native method: CGImageCreateWithImageInRect
We are looking at improving our cross referencing with the native API, but a static "WithFoo" to map to methods like this is not uncommon.
Depending on your setting while reading doc you might be seeing the swift name cropping(to:), which is better. Most of our bindings predates those new names, so you'll have a better chance searching our docs with the C (or ObjC) API names.
@spouliot @chamons Makes sense thanks. If I find something not mapped going forward I'll switch from Swift to Objective C in the Apple doc, and know I'll likely find the Xamarin mapping there.
Most helpful comment
Depending on your setting while reading doc you might be seeing the swift name
cropping(to:), which is better. Most of our bindings predates those new names, so you'll have a better chance searching our docs with the C (or ObjC) API names.