android.graphics.Bitmap.hasMipMap()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(1.9k)|赞(0)|评价(0)|浏览(113)

本文整理了Java中android.graphics.Bitmap.hasMipMap()方法的一些代码示例,展示了Bitmap.hasMipMap()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bitmap.hasMipMap()方法的具体详情如下:
包路径:android.graphics.Bitmap
类名称:Bitmap
方法名:hasMipMap

Bitmap.hasMipMap介绍

暂无

代码示例

代码示例来源:origin: robolectric/robolectric

@Test
@Config(minSdk = JELLY_BEAN_MR1)
public void hasMipmap() {
 Bitmap bitmap = Bitmap.createBitmap(100, 200, Bitmap.Config.ARGB_8888);
 assertThat(bitmap.hasMipMap()).isFalse();
 bitmap.setHasMipMap(true);
 assertThat(bitmap.hasMipMap()).isTrue();
}

代码示例来源:origin: kingargyle/adt-leanback-support

@Override
public boolean hasMipMap() {
  return mBitmap != null && mBitmap.hasMipMap();
}

代码示例来源:origin: kingargyle/adt-leanback-support

public static boolean hasMipMap(Bitmap bitmap) {
  return bitmap.hasMipMap();
}

代码示例来源:origin: jbruchanov/AnUitor

@Override
  protected HashMap<String, Object> fillValues(Bitmap b, HashMap<String, Object> data, HashMap<String, Object> contextData) {

    data.put("DescribeContents", b.describeContents());
    data.put("Config", String.valueOf(b.getConfig()));
    data.put("Density", b.getDensity());
    data.put("Height", b.getHeight());
    data.put("NinePatchChunk", Arrays.toString(b.getNinePatchChunk()));
    data.put("RowBytes", b.getRowBytes());
    data.put("Width", b.getWidth());
    data.put("HasAlpha", b.hasAlpha());
    data.put("IsMutable", b.isMutable());
    data.put("IsRecycled", b.isRecycled());

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
      data.put("AllocationByteCount", b.getAllocationByteCount());
    }
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR1) {
      data.put("ByteCount", b.getByteCount());
      data.put("GenerationId", b.getGenerationId());
    }
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
      data.put("HasMipMap", b.hasMipMap());
      data.put("IsPremultiplied", b.isPremultiplied());
    }

    return data;
  }
}

相关文章