小编Red*_*man的帖子

如何在android中将2d int数组转换为位图

我需要将2d整数数组(subSrc)转换为位图.有解决方案吗

    private Bitmap decimation(Bitmap src){
     Bitmap dest = Bitmap.createBitmap(
       src.getWidth(), src.getHeight(), src.getConfig());

     int bmWidth = src.getWidth();
     int bmHeight = src.getHeight();`enter code here`

int[][] subSrc = new int[bmWidth/2][bmWidth/2];
       for(int k = 0; k < bmWidth-2; k++){
        for(int l = 0; l < bmHeight-2; l++){
         subSrc[k][l] = src.getPixel(2*k, 2*l); <---- ??
Run Code Online (Sandbox Code Playgroud)

android

4
推荐指数
2
解决办法
3306
查看次数

标签 统计

android ×1