我正在尝试绑定* .framework库,该库(除其他外)使用CoreGraphics
。因此,由Sharpie生成的代码如下:
// +(CGImageRef)rotateCGImage:(CGImageRef)image byRadians:(double)radians;
[Static]
[Export ("rotateCGImage:byRadians:")]
unsafe CGImageRef* RotateCGImage (CGImageRef* image, double radians);
但是,当尝试构建它时,我收到诸如“ CGImageRef找不到”的错误消息。另外,我在CoreGraphics
的Assembly Explorer
成员列表中找不到对应的类。(与using CoreGraphics;
无济于事。)
Mono似乎不支持此类(或结构):我只是在常规iOS项目库中也找不到它。
实际上,有许多类似的类似于“ ref-like”的类被遗漏了:CMSampleBufferRef
中的Core Media
,CVImageBufferRef
中的Core Video
等。
所以,我该如何处理这种情况?
请尝试this thread中的解决方案:
CGImageRef
在Xamarin中不存在。在Obj-C中,CGImageRef
只是指向CGImage
的指针,因此我认为您可以将所有这些CGImageRef
更改为CGImage
。
我认为应该是这样的:
[Static]
[Export("rotateCGImage:byRadians:")]
unsafe CGImage RotateCGImage(CGImage image, double radians);
与项目中其他“ ...Ref
”相同。