语言

LinearGradient 构造函数

定义

重载

名称 说明
LinearGradient(IntPtr, JniHandleOwnership)

创建 JNI 对象的托管表示形式时使用的构造函数;由运行时调用。

LinearGradient(Single, Single, Single, Single, Color, Color, Shader+TileMode)

创建一个着色器,该着色器沿线条绘制线性渐变。

LinearGradient(Single, Single, Single, Single, Int32[], Single[], Shader+TileMode)

创建一个着色器,该着色器沿线条绘制线性渐变。

LinearGradient(Single, Single, Single, Single, Int64, Int64, Shader+TileMode)

创建一个着色器,该着色器沿线条绘制线性渐变。

LinearGradient(Single, Single, Single, Single, Int64[], Single[], Shader+TileMode)

创建一个着色器,该着色器沿线条绘制线性渐变。

LinearGradient(IntPtr, JniHandleOwnership)

创建 JNI 对象的托管表示形式时使用的构造函数;由运行时调用。

protected LinearGradient(IntPtr javaReference, Android.Runtime.JniHandleOwnership transfer);
new Android.Graphics.LinearGradient : nativeint * Android.Runtime.JniHandleOwnership -> Android.Graphics.LinearGradient

参数

javaReference
IntPtr

nativeint

IntPtr一个包含Java本机接口 (JNI) 对象引用。

transfer
JniHandleOwnership

指示 JniHandleOwnership如何处理 javaReference

注解

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

适用于

LinearGradient(Single, Single, Single, Single, Color, Color, Shader+TileMode)

创建一个着色器,该着色器沿线条绘制线性渐变。

[Android.Runtime.Register(".ctor", "(FFFFIILandroid/graphics/Shader$TileMode;)V", "")]
public LinearGradient(float x0, float y0, float x1, float y1, Android.Graphics.Color color0, Android.Graphics.Color color1, Android.Graphics.Shader.TileMode tile);
[<Android.Runtime.Register(".ctor", "(FFFFIILandroid/graphics/Shader$TileMode;)V", "")>]
new Android.Graphics.LinearGradient : single * single * single * single * Android.Graphics.Color * Android.Graphics.Color * Android.Graphics.Shader.TileMode -> Android.Graphics.LinearGradient

参数

x0
Single

渐变线起点的 x 坐标

y0
Single

渐变线起点的 y 坐标

x1
Single

渐变线末尾的 x 坐标

y1
Single

渐变线末尾的 y 坐标

color0
Color

渐变线开头的 sRGB 颜色。

color1
Color

渐变线末尾的 sRGB 颜色。

tile
Shader.TileMode

着色器平铺模式

特性

注解

Java文档android.graphics.LinearGradient.LinearGradient(float, float, float, float, int, int, android.graphics.TileMode)。

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

适用于

LinearGradient(Single, Single, Single, Single, Int32[], Single[], Shader+TileMode)

创建一个着色器,该着色器沿线条绘制线性渐变。

[Android.Runtime.Register(".ctor", "(FFFF[I[FLandroid/graphics/Shader$TileMode;)V", "")]
public LinearGradient(float x0, float y0, float x1, float y1, int[] colors, float[]? positions, Android.Graphics.Shader.TileMode tile);
[<Android.Runtime.Register(".ctor", "(FFFF[I[FLandroid/graphics/Shader$TileMode;)V", "")>]
new Android.Graphics.LinearGradient : single * single * single * single * int[] * single[] * Android.Graphics.Shader.TileMode -> Android.Graphics.LinearGradient

参数

x0
Single

渐变线起点的 x 坐标

y0
Single

渐变线起点的 y 坐标

x1
Single

渐变线末尾的 x 坐标

y1
Single

渐变线末尾的 y 坐标

colors
Int32[]

沿渐变线分布的 sRGB 颜色。 此值不能为 null。

positions
Single[]

可以为 null。 颜色数组中每个相应颜色的相对位置 [0..1]。 如果为 null,则颜色沿渐变线均匀分布。

tile
Shader.TileMode

着色器平铺模式

特性

注解

创建一个着色器,该着色器沿线条绘制线性渐变。

Android 参考。android.graphics.LinearGradient.LinearGradient

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

适用于

LinearGradient(Single, Single, Single, Single, Int64, Int64, Shader+TileMode)

创建一个着色器,该着色器沿线条绘制线性渐变。

[Android.Runtime.Register(".ctor", "(FFFFJJLandroid/graphics/Shader$TileMode;)V", "", ApiSince=29)]
public LinearGradient(float x0, float y0, float x1, float y1, long color0, long color1, Android.Graphics.Shader.TileMode tile);
[<Android.Runtime.Register(".ctor", "(FFFFJJLandroid/graphics/Shader$TileMode;)V", "", ApiSince=29)>]
new Android.Graphics.LinearGradient : single * single * single * single * int64 * int64 * Android.Graphics.Shader.TileMode -> Android.Graphics.LinearGradient

参数

x0
Single

渐变线起点的 x 坐标

y0
Single

渐变线起点的 y 坐标

x1
Single

渐变线末尾的 x 坐标

y1
Single

渐变线末尾的 y 坐标

color0
Int64

渐变线开头的 sRGB 颜色。

color1
Int64

渐变线末尾的 sRGB 颜色。

tile
Shader.TileMode

着色器平铺模式

特性

注解

Java文档android.graphics.LinearGradient.LinearGradient(float, float, float, float, int, int, android.graphics.TileMode)。

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

适用于

LinearGradient(Single, Single, Single, Single, Int64[], Single[], Shader+TileMode)

创建一个着色器,该着色器沿线条绘制线性渐变。

[Android.Runtime.Register(".ctor", "(FFFF[J[FLandroid/graphics/Shader$TileMode;)V", "", ApiSince=29)]
public LinearGradient(float x0, float y0, float x1, float y1, long[] colors, float[]? positions, Android.Graphics.Shader.TileMode tile);
[<Android.Runtime.Register(".ctor", "(FFFF[J[FLandroid/graphics/Shader$TileMode;)V", "", ApiSince=29)>]
new Android.Graphics.LinearGradient : single * single * single * single * int64[] * single[] * Android.Graphics.Shader.TileMode -> Android.Graphics.LinearGradient

参数

x0
Single

渐变线起点的 x 坐标

y0
Single

渐变线起点的 y 坐标

x1
Single

渐变线末尾的 x 坐标

y1
Single

渐变线末尾的 y 坐标

colors
Int64[]

沿渐变线分布的颜色。 此值不能为 null。

positions
Single[]

可以为 null。 颜色数组中每个相应颜色的相对位置 [0..1]。 如果为 null,则颜色沿渐变线均匀分布。

tile
Shader.TileMode

着色器平铺模式

特性

注解

创建一个着色器,该着色器沿线条绘制线性渐变。

Android 参考。android.graphics.LinearGradient.LinearGradient

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

适用于