public static final class MediaStore.Images.Media
extends Object
implements MediaStore.Images.ImageColumns
java.lang.Object | |
↳ | android.provider.MediaStore.Images.Media |
Constants |
|
---|---|
String |
CONTENT_TYPE 这个图像目录的MIME类型。 |
String |
DEFAULT_SORT_ORDER 此表的默认排序顺序 |
Inherited constants |
---|
From interface android.provider.MediaStore.Images.ImageColumns
|
From interface android.provider.MediaStore.MediaColumns
|
From interface android.provider.BaseColumns
|
Fields |
|
---|---|
public static final Uri |
EXTERNAL_CONTENT_URI 内容://“主”外部存储卷的样式URI。 |
public static final Uri |
INTERNAL_CONTENT_URI 内容://内部存储的样式URI。 |
Public constructors |
|
---|---|
MediaStore.Images.Media() |
Public methods |
|
---|---|
static final Bitmap |
getBitmap(ContentResolver cr, Uri url) |
static Uri |
getContentUri(String volumeName) 获取给定卷上图像媒体表的content:// style URI。 |
static final String |
insertImage(ContentResolver cr, String imagePath, String name, String description) 插入图像并为其创建缩略图。 |
static final String |
insertImage(ContentResolver cr, Bitmap source, String title, String description) 插入图像并为其创建缩略图。 |
static final Cursor |
query(ContentResolver cr, Uri uri, String[] projection) |
static final Cursor |
query(ContentResolver cr, Uri uri, String[] projection, String where, String orderBy) |
static final Cursor |
query(ContentResolver cr, Uri uri, String[] projection, String selection, String[] selectionArgs, String orderBy) |
Inherited methods |
|
---|---|
From class java.lang.Object
|
String CONTENT_TYPE
这个图像目录的MIME类型。 请注意,根据需要,此目录中的每个条目都将具有标准图像MIME类型 - 例如image / jpeg。
常量值:“vnd.android.cursor.dir / image”
String DEFAULT_SORT_ORDER
此表的默认排序顺序
常量值:“bucket_display_name”
Bitmap getBitmap (ContentResolver cr, Uri url)
Parameters | |
---|---|
cr |
ContentResolver : The content resolver to use |
url |
Uri : The url of the image |
Returns | |
---|---|
Bitmap |
Throws | |
---|---|
|
FileNotFoundException |
IOException |
|
FileNotFoundException |
Uri getContentUri (String volumeName)
获取给定卷上图像媒体表的content:// style URI。
Parameters | |
---|---|
volumeName |
String : the name of the volume to get the URI for |
Returns | |
---|---|
Uri |
the URI to the image media table on the given volume |
String insertImage (ContentResolver cr, String imagePath, String name, String description)
插入图像并为其创建缩略图。
Parameters | |
---|---|
cr |
ContentResolver : The content resolver to use |
imagePath |
String : The path to the image to insert |
name |
String : The name of the image |
description |
String : The description of the image |
Returns | |
---|---|
String |
The URL to the newly created image |
Throws | |
---|---|
FileNotFoundException |
String insertImage (ContentResolver cr, Bitmap source, String title, String description)
插入图像并为其创建缩略图。
Parameters | |
---|---|
cr |
ContentResolver : The content resolver to use |
source |
Bitmap : The stream to use for the image |
title |
String : The name of the image |
description |
String : The description of the image |
Returns | |
---|---|
String |
The URL to the newly created image, or null if the image failed to be stored for any reason. |
Cursor query (ContentResolver cr, Uri uri, String[] projection)
Parameters | |
---|---|
cr |
ContentResolver
|
uri |
Uri
|
projection |
String
|
Returns | |
---|---|
Cursor |
Cursor query (ContentResolver cr, Uri uri, String[] projection, String where, String orderBy)
Parameters | |
---|---|
cr |
ContentResolver
|
uri |
Uri
|
projection |
String
|
where |
String
|
orderBy |
String
|
Returns | |
---|---|
Cursor |
Cursor query (ContentResolver cr, Uri uri, String[] projection, String selection, String[] selectionArgs, String orderBy)
Parameters | |
---|---|
cr |
ContentResolver
|
uri |
Uri
|
projection |
String
|
selection |
String
|
selectionArgs |
String
|
orderBy |
String
|
Returns | |
---|---|
Cursor |