Android API Chinese (112) -- ThumbnailUtils

Source: Internet
Author: User

Preface

This chapter describes android. media. ThumbnailUtils and its version is Android 3.0 r1! I look forward to your participation in Android API translation, contact me over140@gmail.com.

 

Statement

You are welcome to repost, but please keep the original source of the article :)

Blog Garden: http://www.cnblogs.com/

Android Chinese translation group: http://goo.gl/6vJQl

 

Body

I. Structure

Public class ThumbnailUtils extends Object

Java. lang. Object

Android. media. ThumbnailUtils

 

Ii. Overview

Generate regular thumbnails for the media. (Android123: this class is a new class added to Android2.2, which can help us retrieve thumbnails of video or image files in the system from mediaprovider)

 

3. Constants

Public static final intOPTIONS_RECYCLE_INPUT

Constants are used to indicate that they should be recycled.extractThumbnail(Bitmap, int, int, int)Enter the source image (the first parameter) unless the output image is the input image.

Constant Value: 2 (0x00000002)

 

Iv. Public Methods

Public static BitmapCreateVideoThumbnail(String filePath, int kind)

Create a thumbnail of a video. If the video is damaged or the format is not supported, null may be returned.

Parameters

FilePath: Specifies the video file path.

Kind can be MINI_KIND or MICRO_KIND

 

Public static BitmapExtractThumbnail(Bitmap source, int width, int height, int options)

Create a bitmap with the required size and center scaling.

Parameters

Source

Width

Height: Target height

Options

 

Public static BitmapExtractThumbnail(Bitmap source, int width, int height)

Create a bitmap with the required size and center scaling.

Parameters

Source

Width

Height: Target height

 

5. Supplement

Article Link

ThumbnailUtils-Android2.2 new class (Android123)

[Recommended] source code of the Android thumbnail class (Android123)

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.