get Bitmap Micro Thumbnail - Android Graphics

Android examples for Graphics:Bitmap Thumbnail

Description

get Bitmap Micro Thumbnail

Demo Code


//package com.java2s;
import android.content.ContentResolver;

import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
import android.graphics.BitmapFactory;
import android.graphics.BitmapFactory.Options;
import android.provider.MediaStore.Images;
import android.provider.MediaStore.Video;

public class Main {
    public static Bitmap getMicroThumbnail(ContentResolver cr, int origId,
            boolean isVideo) {
        BitmapFactory.Options options = new Options();
        options.inPreferredConfig = Config.ARGB_8888;
        if (!isVideo)
            return Images.Thumbnails.getThumbnail(cr, origId,
                    Images.Thumbnails.MICRO_KIND, options);
        else//from   ww w . j a  va2s. c  o  m
            return Video.Thumbnails.getThumbnail(cr, origId,
                    Video.Thumbnails.MICRO_KIND, options);
    }
}

Related Tutorials