我正在尝试将照片球体图像加载到活动中,并像在Gallery中一样查看它。我似乎在网上找不到任何这个功能的例子或示例。
文档全景客户端
关于如何实现这一目标的想法、示例、代码集或建议?
Photo Sphere API的公告文章详细介绍了如何从URI:加载PhotoSphere
// This listener will be called with information about the given panorama.
OnPanoramaInfoLoadedListener infoLoadedListener =
new OnPanoramaInfoLoadedListener() {
@Override
public void onPanoramaInfoLoaded(ConnectionResult result,
Intent viewerIntent) {
if (result.isSuccess()) {
// If the intent is not null, the image can be shown as a
// panorama.
if (viewerIntent != null) {
// Use the given intent to start the panorama viewer.
startActivity(viewerIntent);
}
}
// If viewerIntent is null, the image is not a viewable panorama.
}
};
// Create client instance and connect to it.
PanoramaClient client = ...
...
// Once connected to the client, initiate the asynchronous check on whether
// the image is a viewable panorama.
client.loadPanoramaInfo(infoLoadedListener, panoramaUri);
请注意,这将在他们的查看器中打开Photo Sphere-没有嵌入到Activity
中的内置Photo Spheres查看器。