Canvas.DrawBitmapMesh Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Draw the bitmap through the mesh, where mesh vertices are evenly distributed across the bitmap.
[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
Parameters
- bitmap
- Bitmap
The bitmap to draw using the mesh
- meshWidth
- Int32
The number of columns in the mesh. Nothing is drawn if this is 0
- meshHeight
- Int32
The number of rows in the mesh. Nothing is drawn if this is 0
- verts
- Single[]
Array of x,y pairs, specifying where the mesh should be drawn. There must be at least (meshWidth+1) * (meshHeight+1) * 2 + vertOffset values in the array
- vertOffset
- Int32
Number of verts elements to skip before drawing
- colors
- Int32[]
May be null. Specifies a color at each vertex, which is interpolated across the cell, and whose values are multiplied by the corresponding bitmap colors. If not null, there must be at least (meshWidth+1) * (meshHeight+1) + colorOffset values in the array.
- colorOffset
- Int32
Number of color elements to skip before drawing
- paint
- Paint
May be null. The paint used to draw the bitmap. Antialiasing is not supported.
- Attributes
Remarks
Draw the bitmap through the mesh, where mesh vertices are evenly distributed across the bitmap. There are meshWidth+1 vertices across, and meshHeight+1 vertices down. The verts array is accessed in row-major order, so that the first meshWidth+1 vertices are distributed across the top of the bitmap from left to right. A more general version of this method is drawVertices().
Prior to API level Build.VERSION_CODES#P
vertOffset and colorOffset were ignored, effectively treating them as zeros. In API level Build.VERSION_CODES#P
and above these parameters will be respected.
Note: antialiasing is not supported, therefore Paint#ANTI_ALIAS_FLAG
is ignored.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.