2011年11月18日金曜日

get thumbnail from video

I used ThumbnailUtils. It create thumbnail from video file.

get thumbnail
Bitmap bmp = ThumbnailUtils.createVideoThumbnail("/sdcard/sample.3gp",MediaStore.Video.Thumbnails.MINI_KIND );

And I add thumbnail to table view.
ImageView image = new ImageView(this);
image.setImageBitmap(bmp);
tablelayout.addView(image, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,LinearLayout.LayoutParams.WRAP_CONTENT));
source code here.

0 件のコメント:

コメントを投稿