ImageDecoder.CreateSource 方法

定义

重载

名称 说明
CreateSource(File)

从文件创建新 Source 项。

CreateSource(ByteBuffer)

从 . Source创建一个新ByteBuffer项。

CreateSource(ICallable)

从可调用的可调用对象创建一个新 Source 值,该对象返回一个 AssetFileDescriptor

CreateSource(Byte[])

从字节数组创建新 Source 项。

CreateSource(ContentResolver, Uri)

从 . Source创建一个新android.net.Uri项。

CreateSource(AssetManager, String)

从资产目录中的文件创建新 Source 文件。

CreateSource(Resources, Int32)

从资源创建新 Source 项。

CreateSource(Byte[], Int32, Int32)

从字节数组区域创建新 Source 项。

CreateSource(File)

从文件创建新 Source 项。

[Android.Runtime.Register("createSource", "(Ljava/io/File;)Landroid/graphics/ImageDecoder$Source;", "", ApiSince=28)]
public static Android.Graphics.ImageDecoder.Source CreateSource(Java.IO.File file);
[<Android.Runtime.Register("createSource", "(Ljava/io/File;)Landroid/graphics/ImageDecoder$Source;", "", ApiSince=28)>]
static member CreateSource : Java.IO.File -> Android.Graphics.ImageDecoder.Source

参数

file
File

返回

一个新的 Source 对象,可以传递给 #decodeDrawable#decodeBitmap

属性

注解

Android 参考。android.graphics.ImageDecoder.createSource(java.io.File)

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于

CreateSource(ByteBuffer)

从 . Source创建一个新ByteBuffer项。

[Android.Runtime.Register("createSource", "(Ljava/nio/ByteBuffer;)Landroid/graphics/ImageDecoder$Source;", "", ApiSince=28)]
public static Android.Graphics.ImageDecoder.Source CreateSource(Java.Nio.ByteBuffer buffer);
[<Android.Runtime.Register("createSource", "(Ljava/nio/ByteBuffer;)Landroid/graphics/ImageDecoder$Source;", "", ApiSince=28)>]
static member CreateSource : Java.Nio.ByteBuffer -> Android.Graphics.ImageDecoder.Source

参数

buffer
ByteBuffer

返回

一个新的 Source 对象,可以传递给 #decodeDrawable#decodeBitmap

属性

注解

Android 参考。android.graphics.ImageDecoder.createSource(java.nio.ByteBuffer)

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于

CreateSource(ICallable)

从可调用的可调用对象创建一个新 Source 值,该对象返回一个 AssetFileDescriptor

[Android.Runtime.Register("createSource", "(Ljava/util/concurrent/Callable;)Landroid/graphics/ImageDecoder$Source;", "", ApiSince=29)]
public static Android.Graphics.ImageDecoder.Source CreateSource(Java.Util.Concurrent.ICallable callable);
[<Android.Runtime.Register("createSource", "(Ljava/util/concurrent/Callable;)Landroid/graphics/ImageDecoder$Source;", "", ApiSince=29)>]
static member CreateSource : Java.Util.Concurrent.ICallable -> Android.Graphics.ImageDecoder.Source

参数

callable
ICallable

返回

一个新的 Source 对象,可以传递给 #decodeDrawable#decodeBitmap

属性

注解

Android 参考。android.graphics.ImageDecoder.createSource(java.util.concurrent.Callable<android.content.res.AssetFileDescriptor>)

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于

CreateSource(Byte[])

从字节数组创建新 Source 项。

[Android.Runtime.Register("createSource", "([B)Landroid/graphics/ImageDecoder$Source;", "", ApiSince=31)]
public static Android.Graphics.ImageDecoder.Source CreateSource(byte[] data);
[<Android.Runtime.Register("createSource", "([B)Landroid/graphics/ImageDecoder$Source;", "", ApiSince=31)>]
static member CreateSource : byte[] -> Android.Graphics.ImageDecoder.Source

参数

data
Byte[]

压缩图像数据的字节数组。 此值不能为 null。

返回

一个新的 Source 对象,可以传递给 #decodeDrawable#decodeBitmap

属性

注解

Android 参考。android.graphics.ImageDecoder.createSource

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于

CreateSource(ContentResolver, Uri)

从 . Source创建一个新android.net.Uri项。

[Android.Runtime.Register("createSource", "(Landroid/content/ContentResolver;Landroid/net/Uri;)Landroid/graphics/ImageDecoder$Source;", "", ApiSince=28)]
public static Android.Graphics.ImageDecoder.Source CreateSource(Android.Content.ContentResolver cr, Android.Net.Uri uri);
[<Android.Runtime.Register("createSource", "(Landroid/content/ContentResolver;Landroid/net/Uri;)Landroid/graphics/ImageDecoder$Source;", "", ApiSince=28)>]
static member CreateSource : Android.Content.ContentResolver * Android.Net.Uri -> Android.Graphics.ImageDecoder.Source

参数

cr
ContentResolver

从中检索。

uri
Uri

图像文件的

返回

一个新的 Source 对象,可以传递给 #decodeDrawable#decodeBitmap

属性

注解

Android 参考。android.graphics.ImageDecoder.createSource(android.content.ContentResolver, android.net.Uri)

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于

CreateSource(AssetManager, String)

从资产目录中的文件创建新 Source 文件。

[Android.Runtime.Register("createSource", "(Landroid/content/res/AssetManager;Ljava/lang/String;)Landroid/graphics/ImageDecoder$Source;", "", ApiSince=28)]
public static Android.Graphics.ImageDecoder.Source CreateSource(Android.Content.Res.AssetManager assets, string fileName);
[<Android.Runtime.Register("createSource", "(Landroid/content/res/AssetManager;Ljava/lang/String;)Landroid/graphics/ImageDecoder$Source;", "", ApiSince=28)>]
static member CreateSource : Android.Content.Res.AssetManager * string -> Android.Graphics.ImageDecoder.Source

参数

assets
AssetManager
fileName
String

返回

一个新的 Source 对象,可以传递给 #decodeDrawable#decodeBitmap

属性

注解

Android 参考。android.graphics.ImageDecoder.createSource(android.content.res.AssetManager, java.lang.String)

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于

CreateSource(Resources, Int32)

从资源创建新 Source 项。

[Android.Runtime.Register("createSource", "(Landroid/content/res/Resources;I)Landroid/graphics/ImageDecoder$Source;", "", ApiSince=28)]
public static Android.Graphics.ImageDecoder.Source CreateSource(Android.Content.Res.Resources res, int resId);
[<Android.Runtime.Register("createSource", "(Landroid/content/res/Resources;I)Landroid/graphics/ImageDecoder$Source;", "", ApiSince=28)>]
static member CreateSource : Android.Content.Res.Resources * int -> Android.Graphics.ImageDecoder.Source

参数

res
Resources

包含图像数据的 Resources 对象。 此值不能为 null。

resId
Int32

图像数据的资源 ID。

返回

一个新的 Source 对象,可以传递给 #decodeDrawable#decodeBitmap

属性

注解

Android 参考。android.graphics.ImageDecoder.createSource

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于

CreateSource(Byte[], Int32, Int32)

从字节数组区域创建新 Source 项。

[Android.Runtime.Register("createSource", "([BII)Landroid/graphics/ImageDecoder$Source;", "", ApiSince=31)]
public static Android.Graphics.ImageDecoder.Source CreateSource(byte[] data, int offset, int length);
[<Android.Runtime.Register("createSource", "([BII)Landroid/graphics/ImageDecoder$Source;", "", ApiSince=31)>]
static member CreateSource : byte[] * int * int -> Android.Graphics.ImageDecoder.Source

参数

data
Byte[]

压缩图像数据的字节数组。 此值不能为 null。

offset
Int32

偏移到解码器开始分析的位置的数据。

length
Int32

要分析的字节数(以偏移量开头)。

返回

一个新的 Source 对象,可以传递给 #decodeDrawable#decodeBitmap

属性

注解

Android 参考。android.graphics.ImageDecoder.createSource

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于