Android PanoramaGL不支持图片

时间:2014-08-15 06:55:59

标签: android

我正在使用具有全景查看器的应用程序并且我正在使用PanoramaGL。我的所有图像都是从互联网上下载的,每张图片的大小都是1200x1200。我试图调整图像大小,但它没有帮助。有什么想法吗?

1 个答案:

答案 0 :(得分:0)

尝试使用此代码以调整其大小:

PLSpherical2Panorama panorama = new PLSpherical2Panorama();

    int heigh_pxl= output.getHeight();
    int width_pxl= output.getWidth();

    double size=Utils.sizeOf(output)/1048576;
    Log.d(TAG, "prima: "+size +" MB     "+width_pxl+"x"+heigh_pxl);

    if(width_pxl>=2048){
        width_pxl=2048;
        heigh_pxl=1024;
        output=Bitmap.createScaledBitmap(output, 2048, 1024, false);
        size=Utils.sizeOf(output)/1048576;
        Log.d(TAG, "dopo: "+size+" MB"+2048+"x"+1024);
    }else{
        width_pxl=Utils.nearestPOwerOf2(width_pxl);
        output=Bitmap.createScaledBitmap(output, width_pxl, width_pxl/2, false);
    }