类 EaseImageResizer
- java.lang.Object
-
- io.agora.chat.uikit.widget.video.EaseImageWorker
-
- io.agora.chat.uikit.widget.video.EaseImageResizer
-
public class EaseImageResizer extends EaseImageWorker
-
-
嵌套类概要
-
从类继承的嵌套类/接口 io.agora.chat.uikit.widget.video.EaseImageWorker
EaseImageWorker.CacheAsyncTask
-
-
字段概要
字段 修饰符和类型 字段 说明 protected intmImageHeightprotected intmImageWidth-
从类继承的字段 io.agora.chat.uikit.widget.video.EaseImageWorker
DUAL_THREAD_EXECUTOR, mPauseWork, mResources
-
-
构造器概要
构造器 构造器 说明 EaseImageResizer(android.content.Context context, int imageSize)Initialize providing a single target image size (used for both width and height);EaseImageResizer(android.content.Context context, int imageWidth, int imageHeight)Initialize providing a single target image size (used for both width and height);
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 static intcalculateInSampleSize(android.graphics.BitmapFactory.Options options, int reqWidth, int reqHeight)Calculate an inSampleSize for use in aBitmapFactory.Optionsobject when decoding bitmaps using the decode* methods fromBitmapFactory.static android.graphics.BitmapdecodeSampledBitmapFromDescriptor(java.io.FileDescriptor fileDescriptor, int reqWidth, int reqHeight, EaseImageCache cache)Decode and sample down a bitmap from a file input stream to the requested width and height.static android.graphics.BitmapdecodeSampledBitmapFromFile(java.lang.String filename, int reqWidth, int reqHeight, EaseImageCache cache)Decode and sample down a bitmap from a file to the requested width and height.static android.graphics.BitmapdecodeSampledBitmapFromResource(android.content.res.Resources res, int resId, int reqWidth, int reqHeight, EaseImageCache cache)Decode and sample down a bitmap from resources to the requested width and height.protected android.graphics.BitmapprocessBitmap(java.lang.Object data)Subclasses should override this to define any processing or work that must happen to produce the final bitmap.voidsetImageSize(int size)Set the target image size (width and height will be the same).voidsetImageSize(int width, int height)Set the target image width and height.-
从类继承的方法 io.agora.chat.uikit.widget.video.EaseImageWorker
addImageCache, cancelPotentialWork, cancelWork, clearCache, clearCacheInternal, closeCache, flushCache, getImageCache, loadImage, setExitTasksEarly, setImageFadeIn, setLoadingImage, setLoadingImage, setPauseWork
-
-
-
-
构造器详细资料
-
EaseImageResizer
public EaseImageResizer(android.content.Context context, int imageWidth, int imageHeight)Initialize providing a single target image size (used for both width and height);- 参数:
context-imageWidth-imageHeight-
-
EaseImageResizer
public EaseImageResizer(android.content.Context context, int imageSize)Initialize providing a single target image size (used for both width and height);- 参数:
context-imageSize-
-
-
方法详细资料
-
setImageSize
public void setImageSize(int width, int height)Set the target image width and height.- 参数:
width-height-
-
setImageSize
public void setImageSize(int size)
Set the target image size (width and height will be the same).- 参数:
size-
-
processBitmap
protected android.graphics.Bitmap processBitmap(java.lang.Object data)
从类复制的说明:EaseImageWorkerSubclasses should override this to define any processing or work that must happen to produce the final bitmap. This will be executed in a background thread and be long running. For example, you could resize a large bitmap here, or pull down an image from the network.- 指定者:
processBitmap在类中EaseImageWorker- 参数:
data- The data to identify which image to process, as provided byEaseImageWorker.loadImage(Object, ImageView)- 返回:
- The processed bitmap
-
decodeSampledBitmapFromResource
public static android.graphics.Bitmap decodeSampledBitmapFromResource(android.content.res.Resources res, int resId, int reqWidth, int reqHeight, EaseImageCache cache)Decode and sample down a bitmap from resources to the requested width and height.- 参数:
res- The resources object containing the image dataresId- The resource id of the image datareqWidth- The requested width of the resulting bitmapreqHeight- The requested height of the resulting bitmapcache- The ImageCache used to find candidate bitmaps for use with inBitmap- 返回:
- A bitmap sampled down from the original with the same aspect ratio and dimensions that are equal to or greater than the requested width and height
-
decodeSampledBitmapFromFile
public static android.graphics.Bitmap decodeSampledBitmapFromFile(java.lang.String filename, int reqWidth, int reqHeight, EaseImageCache cache)Decode and sample down a bitmap from a file to the requested width and height.- 参数:
filename- The full path of the file to decodereqWidth- The requested width of the resulting bitmapreqHeight- The requested height of the resulting bitmapcache- The ImageCache used to find candidate bitmaps for use with inBitmap- 返回:
- A bitmap sampled down from the original with the same aspect ratio and dimensions that are equal to or greater than the requested width and height
-
decodeSampledBitmapFromDescriptor
public static android.graphics.Bitmap decodeSampledBitmapFromDescriptor(java.io.FileDescriptor fileDescriptor, int reqWidth, int reqHeight, EaseImageCache cache)Decode and sample down a bitmap from a file input stream to the requested width and height.- 参数:
fileDescriptor- The file descriptor to read fromreqWidth- The requested width of the resulting bitmapreqHeight- The requested height of the resulting bitmapcache- The ImageCache used to find candidate bitmaps for use with inBitmap- 返回:
- A bitmap sampled down from the original with the same aspect ratio and dimensions that are equal to or greater than the requested width and height
-
calculateInSampleSize
public static int calculateInSampleSize(android.graphics.BitmapFactory.Options options, int reqWidth, int reqHeight)Calculate an inSampleSize for use in aBitmapFactory.Optionsobject when decoding bitmaps using the decode* methods fromBitmapFactory. This implementation calculates the closest inSampleSize that is a power of 2 and will result in the final decoded bitmap having a width and height equal to or larger than the requested width and height.- 参数:
options- An options object with out* params already populated (run through a decode* method with inJustDecodeBounds==truereqWidth- The requested width of the resulting bitmapreqHeight- The requested height of the resulting bitmap- 返回:
- The value to be used for inSampleSize
-
-