android.graphics.Bitmap.Config#ALPHA_8 ( )源码实例Demo

下面列出了android.graphics.Bitmap.Config#ALPHA_8 ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: starcor.xul   文件: BitmapTools.java
public static Bitmap.Config getConfig(Bitmap bmp) {
	Config cfg = bmp.getConfig();
	if (cfg != null) {
		return cfg;
	}
	switch (bmp.getRowBytes() / bmp.getWidth()) {
	case 4: // 32bits rgba8888
		return Config.ARGB_8888;
	case 2: // 16bits rgb565
		return Config.RGB_565;
	case 1: // 8bit
		return Config.ALPHA_8;
	default:
		return defaultConfig;
	}
}
 
源代码2 项目: graphics-samples   文件: ImageCache.java
/**
 * Return the byte usage per pixel of a bitmap based on its configuration.
 *
 * @param config The bitmap configuration.
 * @return The byte usage per pixel.
 */
private static int getBytesPerPixel(Config config) {
    if (config == Config.ARGB_8888) {
        return 4;
    } else if (config == Config.RGB_565) {
        return 2;
    } else if (config == Config.ARGB_4444) {
        return 2;
    } else if (config == Config.ALPHA_8) {
        return 1;
    }
    return 1;
}
 
源代码3 项目: FanXin-based-HuanXin   文件: ImageCache.java
/**
 * Return the byte usage per pixel of a bitmap based on its configuration.
 * 
 * @param config
 *            The bitmap configuration.
 * @return The byte usage per pixel.
 */
private static int getBytesPerPixel(Config config) {
	if (config == Config.ARGB_8888) {
		return 4;
	} else if (config == Config.RGB_565) {
		return 2;
	} else if (config == Config.ARGB_4444) {
		return 2;
	} else if (config == Config.ALPHA_8) {
		return 1;
	}
	return 1;
}
 
源代码4 项目: RoMote   文件: ImageCache.java
/**
 * Return the byte usage per pixel of a bitmap based on its configuration.
 * @param config The bitmap configuration.
 * @return The byte usage per pixel.
 */
private static int getBytesPerPixel(Config config) {
    if (config == Config.ARGB_8888) {
        return 4;
    } else if (config == Config.RGB_565) {
        return 2;
    } else if (config == Config.ARGB_4444) {
        return 2;
    } else if (config == Config.ALPHA_8) {
        return 1;
    }
    return 1;
}
 
源代码5 项目: malevich   文件: ImageCache.java
/**
 * Return the byte usage per pixel of a bitmap based on its configuration.
 * @param config The bitmap configuration.
 * @return The byte usage per pixel.
 */
private static int getBytesPerPixel(Config config) {
    if (config == Config.ARGB_8888) {
        return 4;
    } else if (config == Config.RGB_565) {
        return 2;
    } else if (config == Config.ARGB_4444) {
        return 2;
    } else if (config == Config.ALPHA_8) {
        return 1;
    }
    return 1;
}
 
源代码6 项目: tns-core-modules-widgets   文件: Cache.java
/**
 * Return the byte usage per pixel of a bitmap based on its configuration.
 *
 * @param config The bitmap configuration.
 * @return The byte usage per pixel.
 */
private static int getBytesPerPixel(Config config) {
    if (config == Config.ARGB_8888) {
        return 4;
    } else if (config == Config.RGB_565) {
        return 2;
    } else if (config == Config.ARGB_4444) {
        return 2;
    } else if (config == Config.ALPHA_8) {
        return 1;
    }
    return 1;
}
 
源代码7 项目: BubbleCloudView   文件: ImageCache.java
/**
 * Return the byte usage per pixel of a bitmap based on its configuration.
 * @param config The bitmap configuration.
 * @return The byte usage per pixel.
 */
private static int getBytesPerPixel(Config config) {
    if (config == Config.ARGB_8888) {
        return 4;
    } else if (config == Config.RGB_565) {
        return 2;
    } else if (config == Config.ARGB_4444) {
        return 2;
    } else if (config == Config.ALPHA_8) {
        return 1;
    }
    return 1;
}
 
源代码8 项目: android-DisplayingBitmaps   文件: ImageCache.java
/**
 * Return the byte usage per pixel of a bitmap based on its configuration.
 * @param config The bitmap configuration.
 * @return The byte usage per pixel.
 */
private static int getBytesPerPixel(Config config) {
    if (config == Config.ARGB_8888) {
        return 4;
    } else if (config == Config.RGB_565) {
        return 2;
    } else if (config == Config.ARGB_4444) {
        return 2;
    } else if (config == Config.ALPHA_8) {
        return 1;
    }
    return 1;
}
 
源代码9 项目: cube-sdk   文件: ImageProvider.java
/**
 * Return the byte usage per pixel of a bitmap based on its configuration.
 *
 * @param config The bitmap configuration.
 * @return The byte usage per pixel.
 */
private static int getBytesPerPixel(Config config) {
    if (config == Config.ARGB_8888) {
        return 4;
    } else if (config == Config.RGB_565) {
        return 2;
    } else if (config == Config.ARGB_4444) {
        return 2;
    } else if (config == Config.ALPHA_8) {
        return 1;
    }
    return 1;
}
 
源代码10 项目: vocefiscal-android   文件: ImageCache.java
/**
 * Return the byte usage per pixel of a bitmap based on its configuration.
 * @param config The bitmap configuration.
 * @return The byte usage per pixel.
 */
private static int getBytesPerPixel(Config config) {
    if (config == Config.ARGB_8888) {
        return 4;
    } else if (config == Config.RGB_565) {
        return 2;
    } else if (config == Config.ARGB_4444) {
        return 2;
    } else if (config == Config.ALPHA_8) {
        return 1;
    }
    return 1;
}