Bitmap bMap = ThumbnailUtils.createVideoThumbnail(videopathbundle,
MediaStore.Images.Thumbnails.MICRO_KIND);
In the above code am able to get the thumbnail from video file path. But the image is set in landscape mode. So am now want to rotate and show the image in portrait or vertical. I tried other methods but am not able to get its width and height for rotating the same.
Friends Please help me on this.
I changed it to drawable and then tried to rotate the image but its throwing error on calculating width and height.
Drawable d= new BitmapDrawable(getResources(), bMap);
Bitmap finalThumb = ((BitmapDrawable)d).getBitmap();
Bitmap bmresult = Bitmap.createBitmap(finalThumb);
Canvas tempcanvas = new Canvas(bmresult);
tempcanvas.rotate(90);
tempcanvas.drawBitmap(bmresult, 0, 0, null);
Matrix matrix = new Matrix();
matrix.postRotate(90);
Imageview videoThumb.setImageBitmap(bmresult );