- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我正在从数据库下载图像并想将它们用作 ARReferenceImage,而不是手动将它们添加到 Xcode Assets 文件夹。
代码
let image = #imageLiteral(resourceName: "mike")
let cgImage = image.cgImage
guard let referenceImages = ARReferenceImage.init(cgImage, orientation: .portrait, physicalWidth: 100) else {
fatalError("Failed to load image")
}
错误
对成员“init(_:orientation:physicalWidth:)”的引用不明确
最佳答案
CGImagePropertyOrientation 不支持 .portrait
请使用以下支持:
public enum CGImagePropertyOrientation : UInt32 {
case up // 0th row at top, 0th column on left - default orientation
case upMirrored // 0th row at top, 0th column on right - horizontal flip
case down // 0th row at bottom, 0th column on right - 180 deg rotation
case downMirrored // 0th row at bottom, 0th column on left - vertical flip
case leftMirrored // 0th row on left, 0th column at top
case right // 0th row on right, 0th column at top - 90 deg CW
case rightMirrored // 0th row on right, 0th column on bottom
case left // 0th row on left, 0th column at bottom - 90 deg CCW
}
您的代码:
let referenceImages = ARReferenceImage(cgImage!, orientation: CGImagePropertyOrientation.up, physicalWidth: 100)
或者
let referenceImages = ARReferenceImage.init(cgImage!, orientation: CGImagePropertyOrientation.up, physicalWidth: 100)
关于ios - 以编程方式创建 ARReferenceImage,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50181853/
我正在从数据库下载图像并想将它们用作 ARReferenceImage,而不是手动将它们添加到 Xcode Assets 文件夹。 代码 let image = #imageLiteral(r
目前,我正在使用下面的代码从 Assets.xcassets 的“AR Resources”加载 ARReferenceImage, guard let trackingImages = ARRef
我正在开发一个应用程序,其中数据库中有一组ARReferenceImages,供用户下载和使用。这些 ARReferenceImages 由用户创建。 我已经对用户创建的 ARReferenceIma
我想检查 ARReferenceImage在相机的视野中不再可见。目前我可以检查图像的节点是否在相机的 View 中,但是当 ARReferenceImage 时,该节点在相机的 View 中仍然可见
我正在使用 ARKit 在 ARAnchors 上做一些动画。我的图像存储在如下所示的 AR 资源组中。 因此,可以像下面那样访问它们,以便将它们作为跟踪图像加载到我的 session 中。但是,我还
复制: Xcode 9.3 测试版 iOS 11.3 测试版 2 按照文档 here 将 ARReferenceImages 添加到 Assets.xcassets 编译 结果:错误:运行 actoo
在 iOS SDK iOS 11.3 测试版、xCode 9.3 测试版中,ARKit 1.5 为我们提供了 possibility以与我们使用 ARToolKit 或 Vuforia 相同的方式通过
我是一名优秀的程序员,十分优秀!