本文整理了Java中android.graphics.Bitmap.setPremultiplied()
方法的一些代码示例,展示了Bitmap.setPremultiplied()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bitmap.setPremultiplied()
方法的具体详情如下:
包路径:android.graphics.Bitmap
类名称:Bitmap
方法名:setPremultiplied
暂无
代码示例来源:origin: bumptech/glide
@TargetApi(Build.VERSION_CODES.KITKAT)
private static void maybeSetPreMultiplied(Bitmap bitmap) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
bitmap.setPremultiplied(true);
}
}
代码示例来源:origin: Bilibili/DanmakuFlameMaster
if (result) {
if (android.os.Build.VERSION.SDK_INT >= 17 && !bitmap.isPremultiplied()) {
bitmap.setPremultiplied(true);
代码示例来源:origin: Bilibili/DanmakuFlameMaster
private void accessBitmap(Bitmap bitmap) {
boolean result = (bitmap != null && bitmap.getWidth() == BITMAP_WIDTH && bitmap.getHeight() == BITMAP_HEIGHT);
if (result) {
if (android.os.Build.VERSION.SDK_INT >= 17 && !bitmap.isPremultiplied()) {
bitmap.setPremultiplied(true);
}
Canvas canvas = new Canvas(bitmap);
Paint paint = new Paint();
paint.setColor(Color.RED);
paint.setTextSize(20f);
canvas.drawRect(0f, 0f, (float) bitmap.getWidth(), (float) bitmap.getHeight(),
paint);
canvas.drawText("TestLib", 0, 0, paint);
}
}
代码示例来源:origin: robolectric/robolectric
@Config(sdk = Build.VERSION_CODES.KITKAT)
@Test
public void setPremultiplied() {
Bitmap original = Bitmap.createBitmap(100, 100, Bitmap.Config.ARGB_8888);
assertThat(original.isPremultiplied()).isFalse();
original.setPremultiplied(true);
assertThat(original.isPremultiplied()).isTrue();
original.setPremultiplied(false);
assertThat(original.isPremultiplied()).isFalse();
}
代码示例来源:origin: mozilla-tw/Rocket
@TargetApi(Build.VERSION_CODES.KITKAT)
private static void maybeSetPreMultiplied(Bitmap bitmap) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
bitmap.setPremultiplied(true);
}
}
代码示例来源:origin: chengzichen/KrGallery
bitmap.setHasAlpha(source.hasAlpha());
if (Build.VERSION.SDK_INT >= 19) {
bitmap.setPremultiplied(source.isPremultiplied());
内容来源于网络,如有侵权,请联系作者删除!