iis服务器助手广告广告
返回顶部
首页 > 资讯 > 移动开发 >Android图片缓存之Bitmap详解(一)
  • 615
分享到

Android图片缓存之Bitmap详解(一)

bitmap缓存Android 2022-06-06 07:06:23 615人浏览 薄情痞子
摘要

前言: 最近准备研究一下图片缓存框架,基于这个想法觉得还是先了解有关图片缓存的基础知识,今天重点学习一下Bitmap、BitmapFactory这两个类。  Bitm

前言:
最近准备研究一下图片缓存框架,基于这个想法觉得还是先了解有关图片缓存的基础知识,今天重点学习一下Bitmap、BitmapFactory这两个类。 

Bitmap:
Bitmap是Android系统中的图像处理的最重要类之一。用它可以获取图像文件信息,进行图像剪切、旋转、缩放等操作,并可以指定格式保存图像文件。
 重要函数
 •public void recycle() // 回收位图占用的内存空间,把位图标记为Dead
 •public final boolean isRecycled() //判断位图内存是否已释放  
 •public final int getWidth()//获取位图的宽度 
 •public final int getHeight()//获取位图的高度
 •public final boolean isMutable()//图片是否可修改 
 •public int getScaledWidth(canvas canvas)//获取指定密度转换后的图像的宽度 
 •public int getScaledHeight(Canvas canvas)//获取指定密度转换后的图像的高度 
 •public boolean compress(CompressFORMat format, int quality, OutputStream stream)//按指定的图片格式以及画质,将图片转换为输出流。 
 format:Bitmap.CompressFormat.PNG或Bitmap.CompressFormat.JPEG 
 quality:画质,0-100.0表示最低画质压缩,100以最高画质压缩。对于PNG等无损格式的图片,会忽略此项设置。
 •public static Bitmap createBitmap(Bitmap src) //以src为原图生成不可变得新图像 
 •public static Bitmap createScaledBitmap(Bitmap src, int dstWidth, int dstHeight, boolean filter)//以src为原图,创建新的图像,指定新图像的高宽以及是否可变。 
 •public static Bitmap createBitmap(int width, int height, Config config)——创建指定格式、大小的位图 
 •public static Bitmap createBitmap(Bitmap source, int x, int y, int width, int height)以source为原图,创建新的图片,指定起始坐标以及新图像的高宽。 

BitmapFactory工厂类:
Option 参数类:
 •public boolean inJustDecodeBounds//如果设置为true,不获取图片,不分配内存,但会返回图片的高度宽度信息。
 •public int inSampleSize//图片缩放的倍数
 •public int outWidth//获取图片的宽度值
 •public int outHeight//获取图片的高度值 
 •public int inDensity//用于位图的像素压缩比 
 •public int inTargetDensity//用于目标位图的像素压缩比(要生成的位图) 
 •public byte[] inTempStorage //创建临时文件,将图片存储
 •public boolean inScaled//设置为true时进行图片压缩,从inDensity到inTargetDensity
 •public boolean inDither //如果为true,解码器尝试抖动解码
 •public Bitmap.Config inPreferredConfig //设置解码器
 •public String outMimeType //设置解码图像
 •public boolean inPurgeable//当存储Pixel的内存空间在系统内存不足时是否可以被回收
 •public boolean inInputShareable //inPurgeable为true情况下才生效,是否可以共享一个InputStream
 •public boolean inPreferQualityOverSpeed  //为true则优先保证Bitmap质量其次是解码速度
 •public boolean inMutable //配置Bitmap是否可以更改,比如:在Bitmap上隔几个像素加一条线段
 •public int inScreenDensity //当前屏幕的像素密度 

 工厂方法:
 •public static Bitmap decodeFile(String pathName, Options opts) //从文件读取图片 
 •public static Bitmap decodeFile(String pathName)
 •public static Bitmap decodeStream(InputStream is) //从输入流读取图片
 •public static Bitmap decodeStream(InputStream is, Rect outPadding, Options opts)
 •public static Bitmap decodeResource(Resources res, int id) //从资源文件读取图片
 •public static Bitmap decodeResource(Resources res, int id, Options opts) 
 •public static Bitmap decodeByteArray(byte[] data, int offset, int length) //从数组读取图片
 •public static Bitmap decodeByteArray(byte[] data, int offset, int length, Options opts)
 •public static Bitmap decodeFileDescriptor(FileDescriptor fd)//从文件读取文件 与decodeFile不同的是这个直接调用JNI函数进行读取 效率比较高
 •public static Bitmap decodeFileDescriptor(FileDescriptor fd, Rect outPadding, Options opts) 

Bitmap.Config inPreferredConfig : 
枚举变量 (位图位数越高代表其可以存储的颜色信息越多,图像越逼真,占用内存越大)
 •public static final Bitmap.Config ALPHA_8 //代表8位Alpha位图        每个像素占用1byte内存
 •public static final Bitmap.Config ARGB_4444 //代表16位ARGB位图  每个像素占用2byte内存
 •public static final Bitmap.Config ARGB_8888 //代表32位ARGB位图  每个像素占用4byte内存
 •public static final Bitmap.Config RGB_565 //代表8位RGB位图          每个像素占用2byte内存

Android中一张图片(BitMap)占用的内存主要和以下几个因数有关:图片长度,图片宽度,单位像素占用的字节数。

一张图片(BitMap)占用的内存=图片长度*图片宽度*单位像素占用的字节数 

图片读取实例:
 1.)从文件读取方式一 


 
 public static Bitmap readBitmapFromFile(String filePath, int width, int height) {
  BitmapFactory.Options options = new BitmapFactory.Options();
  options.inJustDecodeBounds = true;
  BitmapFactory.decodeFile(filePath, options);
  float srcWidth = options.outWidth;
  float srcHeight = options.outHeight;
  int inSampleSize = 1;
  if (srcHeight > height || srcWidth > width) {
   if (srcWidth > srcHeight) {
    inSampleSize = Math.round(srcHeight / height);
   } else {
    inSampleSize = Math.round(srcWidth / width);
   }
  }
  options.inJustDecodeBounds = false;
  options.inSampleSize = inSampleSize;
  return BitmapFactory.decodeFile(filePath, options);
 }

 2.)从文件读取方式二 效率高于方式一 



 public static Bitmap readBitmapFromFileDescriptor(String filePath, int width, int height) {
  try {
   FileInputStream fis = new FileInputStream(filePath);
   BitmapFactory.Options options = new BitmapFactory.Options();
   options.inJustDecodeBounds = true;
   BitmapFactory.decodeFileDescriptor(fis.getFD(), null, options);
   float srcWidth = options.outWidth;
   float srcHeight = options.outHeight;
   int inSampleSize = 1;
   if (srcHeight > height || srcWidth > width) {
    if (srcWidth > srcHeight) {
     inSampleSize = Math.round(srcHeight / height);
    } else {
     inSampleSize = Math.round(srcWidth / width);
    }
   }
   options.inJustDecodeBounds = false;
   options.inSampleSize = inSampleSize;
   return BitmapFactory.decodeFileDescriptor(fis.getFD(), null, options);
  } catch (Exception ex) {
  }
  return null;
 }

测试同样生成10张图片两种方式耗时比较 cpu使用以及内存占用两者相差无几 第二种方式效率高一点 所以建议优先采用第二种方式 


  start = System.currentTimeMillis();
  for (int i = 0; i < testMaxCount; i++) {
   BitmapUtils.readBitmapFromFile(filePath, 400, 400);
  }
  end = System.currentTimeMillis();
  Log.e(TAG, "BitmapFactory decodeFile--time-->" + (end - start));
  start = System.currentTimeMillis();
  for (int i = 0; i < testMaxCount; i++) {
   BitmapUtils.readBitmapFromFileDescriptor(filePath, 400, 400);
  }
  end = System.currentTimeMillis();
  Log.e(TAG, "BitmapFactory decodeFileDescriptor--time-->" + (end - start));

3.)从输入流中读取文件 


 
 public static Bitmap readBitmapFromInputStream(InputStream ins, int width, int height) {
  BitmapFactory.Options options = new BitmapFactory.Options();
  options.inJustDecodeBounds = true;
  BitmapFactory.decodeStream(ins, null, options);
  float srcWidth = options.outWidth;
  float srcHeight = options.outHeight;
  int inSampleSize = 1;
  if (srcHeight > height || srcWidth > width) {
   if (srcWidth > srcHeight) {
    inSampleSize = Math.round(srcHeight / height);
   } else {
    inSampleSize = Math.round(srcWidth / width);
   }
  }
  options.inJustDecodeBounds = false;
  options.inSampleSize = inSampleSize;
  return BitmapFactory.decodeStream(ins, null, options);
 }

4.)从资源文件中读取文件  


 public static Bitmap readBitmapFromResource(Resources resources, int resourcesId, int width, int height) {
  BitmapFactory.Options options = new BitmapFactory.Options();
  options.inJustDecodeBounds = true;
  BitmapFactory.decodeResource(resources, resourcesId, options);
  float srcWidth = options.outWidth;
  float srcHeight = options.outHeight;
  int inSampleSize = 1;
  if (srcHeight > height || srcWidth > width) {
   if (srcWidth > srcHeight) {
    inSampleSize = Math.round(srcHeight / height);
   } else {
    inSampleSize = Math.round(srcWidth / width);
   }
  }
  options.inJustDecodeBounds = false;
  options.inSampleSize = inSampleSize;
  return BitmapFactory.decodeResource(resources, resourcesId, options);
 }

 此种方式相当的耗费内存 建议采用decodeStream代替decodeResource 可以如下形式 


 public static Bitmap readBitmapFromResource(Resources resources, int resourcesId, int width, int height) {
  InputStream ins = resources.openRawResource(resourcesId);
  BitmapFactory.Options options = new BitmapFactory.Options();
  options.inJustDecodeBounds = true;
  BitmapFactory.decodeStream(ins, null, options);
  float srcWidth = options.outWidth;
  float srcHeight = options.outHeight;
  int inSampleSize = 1;
  if (srcHeight > height || srcWidth > width) {
   if (srcWidth > srcHeight) {
    inSampleSize = Math.round(srcHeight / height);
   } else {
    inSampleSize = Math.round(srcWidth / width);
   }
  }
  options.inJustDecodeBounds = false;
  options.inSampleSize = inSampleSize;
  return BitmapFactory.decodeStream(ins, null, options);
 }

decodeStream、decodeResource占用内存对比: 


 start = System.currentTimeMillis();
  for (int i = 0; i < testMaxCount; i++) {
   BitmapUtils.readBitmapFromResource(getResources(), R.mipmap.ic_app_center_banner, 400, 400);
   Log.e(TAG, "BitmapFactory decodeResource--num-->" + i);
  }
  end = System.currentTimeMillis();
  Log.e(TAG, "BitmapFactory decodeResource--time-->" + (end - start));
  start = System.currentTimeMillis();
  for (int i = 0; i < testMaxCount; i++) {
   BitmapUtils.readBitmapFromResource1(getResources(), R.mipmap.ic_app_center_banner, 400, 400);
   Log.e(TAG, "BitmapFactory decodeStream--num-->" + i);
  }
  end = System.currentTimeMillis();
  Log.e(TAG, "BitmapFactory decodeStream--time-->" + (end - start));

BitmapFactory.decodeResource 加载的图片可能会经过缩放,该缩放目前是放在 java 层做的,效率比较低,而且需要消耗 java 层的内存。因此,如果大量使用该接口加载图片,容易导致OOM错误。
BitmapFactory.decodeStream 不会对所加载的图片进行缩放,相比之下占用内存少,效率更高。
 这两个接口各有用处,如果对性能要求较高,则应该使用 decodeStream;如果对性能要求不高,且需要 Android 自带的图片自适应缩放功能,则可以使用 decodeResource。 

5. )从二进制数据读取图片 


public static Bitmap readBitmapFromByteArray(byte[] data, int width, int height) {
  BitmapFactory.Options options = new BitmapFactory.Options();
  options.inJustDecodeBounds = true;
  BitmapFactory.decodeByteArray(data, 0, data.length, options);
  float srcWidth = options.outWidth;
  float srcHeight = options.outHeight;
  int inSampleSize = 1;
  if (srcHeight > height || srcWidth > width) {
   if (srcWidth > srcHeight) {
    inSampleSize = Math.round(srcHeight / height);
   } else {
    inSampleSize = Math.round(srcWidth / width);
   }
  }
  options.inJustDecodeBounds = false;
  options.inSampleSize = inSampleSize;
  return BitmapFactory.decodeByteArray(data, 0, data.length, options);
 }

6.)从assets文件读取图片 


 
 public static Bitmap readBitmapFromAssetsFile(Context context, String filePath) {
  Bitmap image = null;
  AssetManager am = context.getResources().getAssets();
  try {
   InputStream is = am.open(filePath);
   image = BitmapFactory.decodeStream(is);
   is.close();
  } catch (IOException e) {
   e.printStackTrace();
  }
  return image;
 }

图片保存文件: 


 public static void writeBitmapToFile(String filePath, Bitmap b, int quality) {
  try {
   File desFile = new File(filePath);
   FileOutputStream fos = new FileOutputStream(desFile);
   BufferedOutputStream bos = new BufferedOutputStream(fos);
   b.compress(Bitmap.CompressFormat.JPEG, quality, bos);
   bos.flush();
   bos.close();
  } catch (IOException e) {
   e.printStackTrace();
  }
 }

图片压缩: 


 private static Bitmap compressImage(Bitmap image) {
  if (image == null) {
   return null;
  }
  ByteArrayOutputStream baos = null;
  try {
   baos = new ByteArrayOutputStream();
   image.compress(Bitmap.CompressFormat.JPEG, 100, baos);
   byte[] bytes = baos.toByteArray();
   ByteArrayInputStream isBm = new ByteArrayInputStream(bytes);
   Bitmap bitmap = BitmapFactory.decodeStream(isBm);
   return bitmap;
  } catch (OutOfMemoryError e) {
  } finally {
   try {
    if (baos != null) {
     baos.close();
    }
   } catch (IOException e) {
   }
  }
  return null;
 }

图片缩放: 


 
 public static Bitmap bitmapScale(Bitmap bitmap, float scale) {
  Matrix matrix = new Matrix();
  matrix.postScale(scale, scale); // 长和宽放大缩小的比例
  Bitmap resizeBmp = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true);
  return resizeBmp;
 }

获取图片旋转角度: 


 
 private static int readPictureDegree(String path) {
  if (TextUtils.isEmpty(path)) {
   return 0;
  }
  int degree = 0;
  try {
   ExifInterface exifInterface = new ExifInterface(path);
   int orientation = exifInterface.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL);
   switch (orientation) {
    case ExifInterface.ORIENTATION_ROTATE_90:
     degree = 90;
     break;
    case ExifInterface.ORIENTATION_ROTATE_180:
     degree = 180;
     break;
    case ExifInterface.ORIENTATION_ROTATE_270:
     degree = 270;
     break;
   }
  } catch (Exception e) {
  }
  return degree;
 }

图片旋转角度: 


  private static Bitmap rotateBitmap(Bitmap b, float rotateDegree) {
    if (b == null) {
      return null;
    }
    Matrix matrix = new Matrix();
    matrix.postRotate(rotateDegree);
    Bitmap rotaBitmap = Bitmap.createBitmap(b, 0, 0, b.getWidth(), b.getHeight(), matrix, true);
    return rotaBitmap;
  }

图片转二进制:


public byte[] bitmap2Bytes(Bitmap bm) {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    bm.compress(Bitmap.CompressFormat.PNG, 100, baos);
    return baos.toByteArray();
  } 

Bitmap转Drawable


public static Drawable bitmapToDrawable(Resources resources, Bitmap bm) {
    Drawable drawable = new BitmapDrawable(resources, bm);
    return drawable;
  } 

Drawable转Bitmap 


 public static Bitmap drawableToBitmap(Drawable drawable) {
    Bitmap bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), drawable.getOpacity() != PixelFormat.OPAQUE ? Bitmap.Config.ARGB_8888 : Bitmap.Config.RGB_565);
    Canvas canvas = new Canvas(bitmap);
    drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());
    drawable.draw(canvas);
    return bitmap;
  }

Drawable、Bitmap占用内存探讨
 之前一直使用过Afinal 和Xutils 熟悉这两框架的都知道,两者出自同一人,Xutils是Afina的升级版,AFinal中的图片内存缓存使用的是Bitmap 而后来为何Xutils将内存缓存的对象改成了Drawable了呢?我们一探究竟 
写个测试程序: 


 List<Bitmap> bitmaps = new ArrayList<>();
    start = System.currentTimeMillis();
    for (int i = 0; i < testMaxCount; i++) {
      Bitmap bitmap = BitmapUtils.readBitMap(this, R.mipmap.ic_app_center_banner);
      bitmaps.add(bitmap);
      Log.e(TAG, "BitmapFactory Bitmap--num-->" + i);
    }
    end = System.currentTimeMillis();
    Log.e(TAG, "BitmapFactory Bitmap--time-->" + (end - start));
    List<Drawable> drawables = new ArrayList<>();
    start = System.currentTimeMillis();
    for (int i = 0; i < testMaxCount; i++) {
      Drawable drawable = getResources().getDrawable(R.mipmap.ic_app_center_banner);
      drawables.add(drawable);
      Log.e(TAG, "BitmapFactory Drawable--num-->" + i);
    }
    end = System.currentTimeMillis();
    Log.e(TAG, "BitmapFactory Drawable--time-->" + (end - start));

测试数据1000 同一张图片

从测试说明Drawable 相对Bitmap有很大的内存占用优势。这也是为啥现在主流的图片缓存框架内存缓存那一层采用Drawable作为缓存对象的原因。
 小结:图片处理就暂时学习到这里,以后再做补充。

您可能感兴趣的文章:Android 图片缓存机制的深入理解Android中Glide加载图片并实现图片缓存Android图片缓存原理、特性对比Android图片缓存之初识Glide(三)直接应用项目中的Android图片缓存技术Android中Glide加载库的图片缓存配置究极指南Android实现图片缓存与异步加载Android开发笔记之图片缓存、手势及OOM分析android上的一个网络接口和图片缓存框架enif简析Android图片三级缓存开发


--结束END--

本文标题: Android图片缓存之Bitmap详解(一)

本文链接: https://www.lsjlt.com/news/24450.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • 详解Android中图片的三级缓存及实例
    详解Android中图片的三级缓存及实例为什么要使用三级缓存 如今的 Android App 经常会需要网络交互,通过网络获取图片是再正常不过的事了 假如每次启动的时候都从网络拉取图片的话,势必会消耗很多流量。在当前的状况下,对于非wi...
    99+
    2023-05-30
    android 三级缓存 roi
  • 详解android 通过uri获取bitmap图片并压缩
    详解android 通过uri获取bitmap图片并压缩很多人在调用图库选择图片时会在onActivityResult中用Media.getBitmap来获取返回的图片,如下:Uri mImageCaptureUri = data.getD...
    99+
    2023-05-30
    android uri bitmap
  • Android 性能优化系列之bitmap图片优化
    背景 Android开发中,加载图片过多、过大很容易引起OutOfMemoryError异常,即我们常见的内存溢出。因为Android对单个应用施加内存限制,默认分配的内存只有几M(...
    99+
    2024-04-02
  • 如何理解Android图片缓存框架Glide
    本篇文章给大家分享的是有关如何理解Android图片缓存框架Glide,小编觉得挺实用的,因此分享给大家学习,希望大家阅读完这篇文章后可以有所收获,话不多说,跟着小编一起来看看吧。Android图片缓存框架GlideGlide是Google...
    99+
    2023-06-05
  • Android WebView 缓存详解
     Android WebView 缓存详解一. 两种缓存类型:页面缓存:加载一个网页时的html、JS、CSS等页面或者资源数据,这些缓存资源是由于浏览器 的行为而产生,开发者只能通过配置HTTP响应头影响浏览器的行为才能间接地影...
    99+
    2023-05-31
    android webview 缓存
  • 详解Android中Bitmap及其内存优化
    小编这次要给大家分享的是详解Android中Bitmap及其内存优化,文章内容丰富,感兴趣的小伙伴可以来了解一下,希望大家阅读完这篇文章之后能够有所收获。Android Bitmap详解及Bitmap的内存优化一、Bitmap:Bitmap...
    99+
    2023-05-31
    android bitmap roi
  • Android中Glide获取缓存大小并清除缓存图片
    清除Glide缓存 Glide自带清除缓存的功能,分别对应Glide.get(context).clearDiskCache();(清除磁盘缓存)与Glide.get(context).clearMemory();(清除内存缓存)两个方法....
    99+
    2023-05-31
    android glide 缓存
  • Android Canvas和Bitmap结合绘图详解流程
    目录Rect/RectFMatrixCanvasBitmapRect/RectF 存储四个值的矩形类:左侧、顶部、右侧和底部。可用于直接在画布上绘制或仅用于存储要绘制的对象的大小。R...
    99+
    2024-04-02
  • Android中怎么实现图片缓存机制
    这期内容当中小编将会给大家带来有关Android中怎么实现图片缓存机制,文章内容丰富且以专业的角度为大家分析和叙述,阅读完这篇文章希望大家可以有所收获。Android 图片缓存机制的深入理解Android加载一张图片到用户界面是很简单的,但...
    99+
    2023-05-30
    android
  • 详解.Net缓存之MemoryCahe
    目录1. MemoryCahe1.1 简单入门1.2 过期时间1.2 常用配置1.3 IChangeToken1.4 引用Nuget包1. MemoryCahe NetCore中的...
    99+
    2024-04-02
  • Android开发之保存图片到相册的三种方法详解
    目录方法一方法二方法三有三种方法如下:三个方法都需要动态申请读写权限否则保存图片到相册也会失败 方法一 public static void saveBitmap(Bit...
    99+
    2024-04-02
  • 详解Flutter网络图片本地缓存的实现
    目录一、问题二、思路三、实现四、使用五、缓存清理一、问题 Flutter原有的图片缓存机制,是通过PaintingBinding.instance!.imageCache来管理缓存的...
    99+
    2023-05-16
    Flutter网络图片本地缓存 Flutter 图片缓存
  • 浅谈Android 中图片的三级缓存策略
    什么是三级缓存? 内存缓存,优先加载,速度最快 本地缓存,次优先加载,速度快 网络缓存,最后加载,速度慢,浪费流量为什么要进行三级缓存三级缓存策略,最实在的意义就是 减少不必要的流量消耗,增加加载速度 。如今的 APP 网络交互似乎已...
    99+
    2023-05-30
    android 图片 三级缓存
  • Android二级缓存加载图片实现照片墙功能
    实现二级缓存加载图片的功能,在使用DiskLruCache时,需先在工程中添加名为libcore.io的包,并将DiskLruCache.Java文件放进去。DiskLruCache直接百度下载即可。在GridView的适配器中,为Imag...
    99+
    2023-05-31
    android 加载图片 照片墙
  • Android 图片加载库之Coil的详解与使用
    一、介绍         在Android,资源的呈现主要有三大形式:文字、图片、视频。图片有分为本地资源和网络资源。 网络资源需要通过下载然后绑定到ImageView中。         在前期我们使用的图片加载框架如:picasso、...
    99+
    2023-10-02
    android kotlin Coil
  • Android 图片的三级缓存机制实例分析
    Android 图片的三级缓存机制实例分析当我们获取图片的时候,如果不加以协调好图片的缓存,就会造成大流量,费流量应用,用户体验不好,影响后期发展。为此,我特地分享Android图片的三级缓存机制之从网络中获取图片,来优化应用,具体分三步进...
    99+
    2023-05-31
    android 图片 三级缓存
  • Android图片三级缓存的原理及其实现
    为什么要使用三级缓存 如今的 Android App 经常会需要网络交互,通过网络获取图片是再正常不过的事了 假如每次启动的时候都从网络拉取图片的话,势必会消耗很多流量。在当前的状况下,对于非wifi用户来说,流量还是很贵的,一个很耗流...
    99+
    2023-05-30
    android 图片 三级缓存
  • php上传图片不缓存怎么解决
    要实现不缓存上传的图片,可以使用以下方法之一:1. 在上传图片的表单中添加随机的参数:html...
    99+
    2023-10-18
    php
  • Python图片处理之图片采样处理详解
    目录一.图像采样处理原理二.图像采样实现三.图像局部采样处理四.总结一.图像采样处理原理 图像采样(Image Sampling)处理是将一幅连续图像在空间上分割成M×N...
    99+
    2024-04-02
  • Android VideoCache视频缓存的方法详解
    Android VideoCache视频缓存的方法详解项目中遇到视频播放,需要加载网络url,不可能每次都进行网络加载,当然了,就需要用到我们的缓存机制AndroidVideoCacheAndroidVideoCache是一个视频/音频缓存...
    99+
    2023-05-30
    android videocache roi
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作