小编Pou*_*rad的帖子

在android'java'中如何将Bitmap对象转换为Image对象,反之亦然

如何将Image obj转换为Bitmap obj,反之亦然


我有一个方法获取Image对象输入并返回Image对象,但我想给位图对象输入然后获取位图对象输出我的代码是这样的:


public Image edgeFilter(Image imageIn) {
    // Image size
    int width = imageIn.getWidth();
    int height = imageIn.getHeight();
    boolean[][] mask = null;
    Paint grayMatrix[] = new Paint[256];

    // Init gray matrix
    for (int i = 0; i <= 255; i++) {
        Paint p = new Paint();
        p.setColor(Color.rgb(i, i, i));
        grayMatrix[i] = p;
    }
    int [][] luminance = new int[width][height];
    for (int y = 0; y < height ; y++) {
        for (int x = 0; x < width …
Run Code Online (Sandbox Code Playgroud)

java android image bitmap

6
推荐指数
1
解决办法
3926
查看次数

标签 统计

android ×1

bitmap ×1

image ×1

java ×1