Android Edit Bitmap Channels

后端 未结 3 1743
不思量自难忘°
不思量自难忘° 2020-12-12 20:09

It\'s possible to access the alpha channel of a given bitmap with extractAlpha(), but I haven\'t been able to find any way to actually set the alpha channel of

3条回答
  •  抹茶落季
    2020-12-12 20:37

    Manipulating Bitmaps is a farily simple thing, when to access the pixel (bytes) directly. To do that in Android you can do it over this approch

    ByteArrayOutputStream bos = new ByteArrayOutputStream(); 
    bitmap.compress(Bitmap.CompressFormat.PNG, 100, bos); 
    byte[] b = bos.toByteArray();  
    

    Now you can do any image manipulation, tranformation or combination you like.

    I hope this is what you were looking for.

提交回复
热议问题