imageview - Poor Image Quality on scaling image in android -
i working on android application development...when click on thumbnail image, enlarges give extreme poor quality...please me how resolve it
imageview ivpreview = (imageview)nagdialog.findviewbyid(r.id.image1); int h =200 ; // height in pixels int w = 200; // width in pixels bitmap scaled = bitmap.createscaledbitmap(bm, h, w, true); ivpreview.setimagebitmap(scaled);
if understand correctly want enlarge thumbnail. bad idea because thumbnails' size small image , enhancing makes worse. bitmap.createscaledbitmap() method stretches bitmap resulting in quality loss. should use bigger original image, create thubmnail image , load original image when click on it. here's code going:
bitmap original = //get original image bitmap thumbnail = bitmap.createscaledbitmap(original, 50, 50, true); //when user clicks on imageview: imgview.setimagebitmap(original);
Comments
Post a Comment