Android CreateBitmap

 

Bitmap中setPiexls的解释:

 

public void setPixels (int[] pixels, int offset, int stride, int x, int y, int width, int height)
Since:  API Level 1

Replace pixels in the bitmap with the colors in the array. Each element in the array is a packed int prepresenting a Color

Parameters
pixelsThe colors to write to the bitmap
offsetThe index of the first color to read from pixels[]
strideThe number of colors in pixels[] to skip between rows. Normally this value will be the same as the width of the bitmap, but it can be larger (or negative).
xThe x coordinate of the first pixel to write to in the bitmap.
yThe y coordinate of the first pixel to write to in the bitmap.
widthThe number of colors to copy from pixels[] per row
heightThe number of rows to write to the bitmap
Throws
IllegalStateExceptionif the bitmap is not mutable
IllegalArgumentExceptionif x, y, width, height are outside of the bitmap's bounds.
ArrayIndexOutOfBoundsExceptionif the pixels array is too small to receive the specified number of pixels.
生成颜色值数组的函数:
 

 


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值