http://www.cn.ibm.com/developerWorks/java/ 有解答

解决方案 »

  1.   

    在anfy3dAPI中有现成的方法提取,并可存入整型变量中!!!请看:
    int aspect[] = new int[2];
    int backgroundPic[]=loadImage("data/spherical.jpg",aspect);
    private int[] loadImage(String imgfileN, int aspect[])
    {
    try // Try catch protection code.
    {
    URL name = new URL(getDocumentBase(),imgfileN); // Make a URL object with the path and picture name...
    return a3dUTIL.imgLoad(name,aspect,this);   // ...and store the image into an array.
    }
    catch(Exception e) // Is there a problem?...
    {
    e.printStackTrace(); // ...print the stack...
    return null; // ...and return null value...
    }
    }