[将静态库绑定到Xamarin.iOS时找不到CGImageRef

问题描述 投票:0回答:1

我正在尝试绑定* .framework库,该库(除其他外)使用CoreGraphics。因此,由Sharpie生成的代码如下:

    // +(CGImageRef)rotateCGImage:(CGImageRef)image byRadians:(double)radians;
    [Static]
    [Export ("rotateCGImage:byRadians:")]
    unsafe CGImageRef* RotateCGImage (CGImageRef* image, double radians);

但是,当尝试构建它时,我收到诸如“ CGImageRef找不到”的错误消息。另外,我在CoreGraphicsAssembly Explorer成员列表中找不到对应的类。(与using CoreGraphics;无济于事。)

Mono似乎不支持此类(或结构):我只是在常规iOS项目库中也找不到它。

实际上,有许多类似的类似于“ ref-like”的类被遗漏了:CMSampleBufferRef中的Core MediaCVImageBufferRef中的Core Video等。

所以,我该如何处理这种情况?

binding xamarin.ios mono core-graphics static-libraries
1个回答
0
投票

请尝试this thread中的解决方案:

CGImageRef在Xamarin中不存在。在Obj-C中,CGImageRef只是指向CGImage的指针,因此我认为您可以将所有这些CGImageRef更改为CGImage

我认为应该是这样的:

[Static]
[Export("rotateCGImage:byRadians:")]
unsafe CGImage RotateCGImage(CGImage image, double radians);

与项目中其他“ ...Ref”相同。

© www.soinside.com 2019 - 2024. All rights reserved.