java - Display jpg from sdcard android -
i cant work anymore
here code:
imageview jpgview = (imageview)findviewbyid(r.id.imageview01); string myjpgpath = "/sdcard/pic.jpg"; jpgview.setvisibility(view.visible); //jpgview.setscaletype(imageview.scaletype.fit_center); jpgview.setadjustviewbounds(true); bitmapfactory.options options = new bitmapfactory.options(); options.insamplesize = 2; bitmap bm = bitmapfactory.decodefile(myjpgpath, options); jpgview.setimagebitmap(bm);
can help?
you can use bitmapdrawable, e.g.
imageview jpgview = (imageview)findviewbyid(r.id.imageview01); string myjpgpath = "/sdcard/pic.jpg"; bitmapdrawable d = new bitmapdrawable(getresources(), myjpgpath); jpgview.setimagedrawable(d);
Comments
Post a Comment