语言

Canvas.DrawBitmapMesh 方法

定义

通过网格绘制位图,其中网格顶点均匀分布于位图中。

[Android.Runtime.Register("drawBitmapMesh", "(Landroid/graphics/Bitmap;II[FI[IILandroid/graphics/Paint;)V", "GetDrawBitmapMesh_Landroid_graphics_Bitmap_IIarrayFIarrayIILandroid_graphics_Paint_Handler")]
public virtual void DrawBitmapMesh(Android.Graphics.Bitmap bitmap, int meshWidth, int meshHeight, float[] verts, int vertOffset, int[]? colors, int colorOffset, Android.Graphics.Paint? paint);
[<Android.Runtime.Register("drawBitmapMesh", "(Landroid/graphics/Bitmap;II[FI[IILandroid/graphics/Paint;)V", "GetDrawBitmapMesh_Landroid_graphics_Bitmap_IIarrayFIarrayIILandroid_graphics_Paint_Handler")>]
abstract member DrawBitmapMesh : Android.Graphics.Bitmap * int * int * single[] * int * int[] * int * Android.Graphics.Paint -> unit
override this.DrawBitmapMesh : Android.Graphics.Bitmap * int * int * single[] * int * int[] * int * Android.Graphics.Paint -> unit

参数

bitmap
Bitmap

使用网格绘制的位图

meshWidth
Int32

网格中的列数。 如果这是 0,则不会绘制任何内容

meshHeight
Int32

网格中的行数。 如果这是 0,则不会绘制任何内容

verts
Single[]

x,y 对的数组,指定应绘制网格的位置。 数组中必须至少有 (meshWidth+1) * (meshHeight+1) * 2 + vertOffset 值

vertOffset
Int32

绘制前要跳过的反转元素数

colors
Int32[]

可以为 null。 指定每个顶点的颜色,该颜色在单元格中内插,其值乘以相应的位图颜色。 如果不是 null,则数组中必须至少有 (meshWidth+1) * (meshHeight+1) + colorOffset 值。

colorOffset
Int32

绘制前要跳过的颜色元素数

paint
Paint

可以为 null。 用于绘制位图的油漆。 不支持抗锯齿。

特性

注解

通过网格绘制位图,其中网格顶点均匀分布于位图中。 有 meshWidth+1 顶点,meshHeight+1 顶点向下。 将按行主顺序访问 verts 数组,以便第一个 meshWidth+1 顶点分布于位图的顶部(从左到右)。 此方法的更常规版本是 drawVertices()。

在 API 级别 Build.VERSION_CODES#P vertOffset 和 colorOffset 之前被忽略,有效地将它们视为零。 在 API 级别及更高版本中 Build.VERSION_CODES#P ,将遵循这些参数。

注意:不支持抗锯齿,因此 Paint#ANTI_ALIAS_FLAG 将被忽略。

Java文档android.graphics.Canvas.drawBitmapMesh(android.graphics.Bitmap, int, int, float[], int, int[], int, android.graphics.Paint)。

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

适用于