类 EaseImageResizer

    • 字段详细资料

      • mImageWidth

        protected int mImageWidth
      • mImageHeight

        protected int mImageHeight
    • 构造器详细资料

      • 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)
        从类复制的说明: EaseImageWorker
        Subclasses 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 by EaseImageWorker.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 data
        resId - The resource id of the image data
        reqWidth - The requested width of the resulting bitmap
        reqHeight - The requested height of the resulting bitmap
        cache - 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 decode
        reqWidth - The requested width of the resulting bitmap
        reqHeight - The requested height of the resulting bitmap
        cache - 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 from
        reqWidth - The requested width of the resulting bitmap
        reqHeight - The requested height of the resulting bitmap
        cache - 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 a BitmapFactory.Options object when decoding bitmaps using the decode* methods from BitmapFactory. 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==true
        reqWidth - The requested width of the resulting bitmap
        reqHeight - The requested height of the resulting bitmap
        返回:
        The value to be used for inSampleSize