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

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

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

Bitmap.getGenerationId介绍

暂无

代码示例

代码示例来源:origin: wasdennnoch/AndroidN-ify

Pair<Boolean, Integer> cached = mGrayscaleBitmapCache.get(bitmap);
if (cached != null) {
  if (cached.second == bitmap.getGenerationId()) {
    return cached.first;
generationId = bitmap.getGenerationId();

代码示例来源: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;
  }
}

相关文章