有没有办法在ImageView中加载全景光球?



我知道有像SphereShare.net这样的画廊可以打开和分享球体形式的全景照片。但是,如何在应用中加载球体呢?

你必须使用PanoramaClient(这是Google Play Services的一部分)来打开PhotoSphere照片。

如何做到这一点的一个例子可以在Android开发者的博客文章中找到:

// 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);

相关内容

  • 没有找到相关文章