Taking thumbnails is not the same as zooming a picture.
Zooming the picture is done without distortion in the case of scale processing, and is smoothed.
Thumbnails are otherwise, allowing distortion, only to remove the outline of the image.
Save Bitmap Pictures
Private void Savebitmap (Bitmap bm,string picname) {log.e (TAG, "Save Picture"); String Icon_dir=mmedialist.get (Mmedialist.size ()-1). Geticonpath (). Replace ("/", "__");// string icon_dir= Picname.replace ("/", "__"); File dir = new file (Environment.getexternalstoragedirectory (). toString () + "/movdo/clip", Icon_dir); if (!dir.exists ()) if (!dir.mkdir ()) LOG.E (tag, "t create dir"), ELSELOG.I (tag, "DIR is created");p icname=picname.replace (". mp4", ". jpg "); File F = new file (Dir.getabsolutepath (), "0.jpg"), if (F.exists ()) {F.delete ();} try {fileoutputstream out = new FileOutputStream (f); bm.compress (Bitmap.CompressFormat.PNG, N, out); Out.flush (); O Ut.close (); LOG.I (TAG, "saved");} catch (FileNotFoundException e) {//Todo auto-generated catch Blocke.printstacktrace ();} catch (IOException e) {//Todo Au To-generated catch Blocke.printstacktrace ();}}
Take thumbnails of pictures
Public Bitmap getimagethumbnail (String filename,bitmap bmp,int width,int height) {Bitmap bitmap= Thumbnailutils.extractthumbnail (BMP, +); Savebitmap (bitmap,filename); return bitmap; }
Take thumbnails of videos
Private Bitmap Getvideothumbnail (String videopath, int width, int height) {Bitmap Bitmap = Null;bitmap = thumbnailutils.cr Eatevideothumbnail (Videopath, thumbnails.mini_kind); bitmap = Thumbnailutils.extractthumbnail (bitmap, width, height, Thumbnailutils.options_recycle_input); String Filename=new string (); Savebitmap (Bitmap,mmedialist.get (Mmedialist.size ()-1). Getitemname ()); return bitmap;}
Parse into bitmap based on path
Bitmap thumb = bitmapfactory.decodefile (filepath); Getimagethumbnail (filename,thumb,300,300);
Android implements thumbnail image for video image