1~
这个不行 因为:
2~
 i.setImageURI(mUrls[position]);
i.setScaleType(ImageView.ScaleType.FIT_XY);  
 i.setLayoutParams(new Gallery.LayoutParams(260, 210));可以得到制定URL的image
并且在界面里可以显示
而用1~代码
 i.buildDrawingCache();
Bitmap bitmap = i.getDrawingCache();已转化为bitmap
在用i.setImageBitmap(bitmap)
就显示不出来了
顺便提一下 打算通过选择的image转化为bitmap在另一个gallery中显示谢谢大家帮忙 散分是必须的! 

解决方案 »

  1.   

    有专门转换成Bitmap的类BitmapFactory
    Public Methods
    static Bitmap  decodeByteArray(byte[] data, int offset, int length, BitmapFactory.Options opts)
    Decode an immutable bitmap from the specified byte array.
    static Bitmap  decodeByteArray(byte[] data, int offset, int length)
    Decode an immutable bitmap from the specified byte array.
    static Bitmap  decodeFile(String pathName)
    Decode a file path into a bitmap.
    static Bitmap  decodeFile(String pathName, BitmapFactory.Options opts)
    Decode a file path into a bitmap.
    static Bitmap  decodeFileDescriptor(FileDescriptor fd)
    Decode a bitmap from the file descriptor.
    static Bitmap  decodeFileDescriptor(FileDescriptor fd, Rect outPadding, BitmapFactory.Options opts)
    Decode a bitmap from the file descriptor.
    static Bitmap  decodeResource(Resources res, int id, BitmapFactory.Options opts)
    Synonym for opening the given resource and calling decodeResourceStream(Resources, TypedValue, InputStream, Rect, BitmapFactory.Options).
    static Bitmap  decodeResource(Resources res, int id)
    Synonym for decodeResource(Resources, int, android.graphics.BitmapFactory.Options) will null Options.
    static Bitmap  decodeResourceStream(Resources res, TypedValue value, InputStream is, Rect pad, BitmapFactory.Options opts)
    Decode a new Bitmap from an InputStream.
    static Bitmap  decodeStream(InputStream is)
    Decode an input stream into a bitmap.
    static Bitmap  decodeStream(InputStream is, Rect outPadding, BitmapFactory.Options opts)
    Decode an input stream into a bitmap.http://www.ideasandroid.com/android/sdk/docs/reference/android/graphics/BitmapFactory.html
      

  2.   

    static Bitmap     decodeFile(String pathName)这个搞定啦 谢啦