android createbitmap参数详解,Bitmap.CreateBitmap Method (Android.Graphics) | Microsoft Docs

本文详细介绍了Android中Bitmap的创建方法,包括使用不同参数创建不可变和可变位图,如DisplayMetrics、颜色数组、配置、矩阵等。这些方法用于创建指定宽度、高度的位图,并提供了从源位图子集创建位图的功能。
摘要由CSDN通过智能技术生成

Bitmap.CreateBitmap Method

Definition

Assembly:Mono.Android.dll

In this article

Overloads

Returns a immutable bitmap with the specified width and height, with each

pixel value set to the corresponding value in the colors array.

Returns an immutable bitmap from subset of the source bitmap,

transformed by the optional matrix.

Returns a immutable bitmap with the specified width and height, with each

pixel value set to the corresponding value in the colors array.

Returns a immutable bitmap with the specified width and height, with each

pixel value set to the corresponding value in the colors array.

Returns an immutable bitmap from the specified subset of the source

bitmap.

Returns a immutable bitmap with the specified width and height, with each

pixel value set to the corresponding value in the colors array.

Returns a mutable bitmap with the specified width and height.

Returns a mutable bitmap with the specified width and height.

Returns an immutable bitmap from the source bitmap.

CreateBitmap(DisplayMetrics, Int32[], Int32, Int32, Int32, Int32, Bitmap+Config)

Returns a immutable bitmap with the specified width and height, with each

pixel value set to the corresponding value in the colors array.

[Android.Runtime.Register("createBitmap", "(Landroid/util/DisplayMetrics;[IIIIILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;", "", ApiSince=17)]

public static Android.Graphics.Bitmap CreateBitmap (Android.Util.DisplayMetrics display, int[] colors, int offset, int stride, int width, int height, Android.Graphics.Bitmap.Config config);

static member CreateBitmap : Android.Util.DisplayMetrics * int[] * int * int * int * int * Android.Graphics.Bitmap.Config -> Android.Graphics.Bitmap

Parameters

Display metrics for the display this bitmap will be

drawn on.

colors

T:Android.Graphics._Color

offset

Number of values to skip before the first color in the

array of colors.

stride

Number of colors in the array between rows (must be >=

width or <= -width).

width

The width of the bitmap

height

The height of the bitmap

The bitmap config to create. If the config does not

support per-pixel alpha (e.g. RGB_565), then the alpha

bytes in the colors[] will be ignored (assumed to be FF)

Returns

Exceptions

if the width or height are <= 0, or if

the color array's length is less than the number of pixels.

Remarks

Portions of this page are modifications based on work created and shared by the

Applies to

CreateBitmap(Bitmap, Int32, Int32, Int32, Int32, Matrix, Boolean)

Returns an immutable bitmap from subset of the source bitmap,

transformed by the opti

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值