类 EaseImageUtils


  • public class EaseImageUtils
    extends io.agora.util.ImageUtils
    • 字段概要

      • 从类继承的字段 io.agora.util.ImageUtils

        SCALE_IMAGE_HEIGHT, SCALE_IMAGE_WIDTH
    • 方法概要

      所有方法 静态方法 具体方法 
      修饰符和类型 方法 说明
      static android.graphics.Bitmap drawableToBitmap​(android.graphics.drawable.Drawable drawable)
      Convert Drawable to Bitmap.
      static int[] getImageMaxSize​(android.content.Context context)
      Get the maximum length and width of the picture
      static java.lang.String getImagePath​(java.lang.String remoteUrl)  
      static java.lang.String getImagePathByFileName​(java.lang.String filename)  
      static android.view.ViewGroup.LayoutParams getImageShowSize​(android.content.Context context, io.agora.chat.ChatMessage message)  
      static android.graphics.drawable.Drawable getRoundedCornerDrawable​(android.content.Context context, android.graphics.Bitmap bitmap, float cornerRadius)
      Get a drawable with corner radius.
      static java.lang.String getThumbnailImagePath​(java.lang.String thumbRemoteUrl)  
      static java.lang.String getThumbnailImagePathByName​(java.lang.String filename)  
      static void setDrawableSize​(android.widget.TextView textView, float defaultSize)  
      static void showImage​(android.content.Context context, android.widget.ImageView imageView, android.net.Uri imageUri, java.lang.String imageUrl, int imgWidth, int imgHeight)
      The logic of displaying pictures is as follows: 1.
      static void showImage​(android.content.Context context, android.widget.ImageView imageView, io.agora.chat.ChatMessage message)
      Show picture
      static void showVideoThumb​(android.content.Context context, android.widget.ImageView imageView, io.agora.chat.ChatMessage message)
      Show video cover
      • 从类继承的方法 io.agora.util.ImageUtils

        calculateInSampleSize, checkDegreeAndRestoreImage, decodeScaleImage, decodeScaleImage, decodeScaleImage, getBitmapByUri, getBitmapOptions, getBitmapOptions, getBitmapOptions, getFileLength, getFilename, getRoundedCornerBitmap, getRoundedCornerBitmap, getScaledImage, getScaledImage, getScaledImage, getScaledImageByUri, getThumbnailImage, getVideoThumbnail, mergeImages, readPictureDegree, readPictureDegree, rotateImageView, saveVideoThumb
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 构造器详细资料

      • EaseImageUtils

        public EaseImageUtils()
    • 方法详细资料

      • getImagePath

        public static java.lang.String getImagePath​(java.lang.String remoteUrl)
      • getImagePathByFileName

        public static java.lang.String getImagePathByFileName​(java.lang.String filename)
      • getThumbnailImagePath

        public static java.lang.String getThumbnailImagePath​(java.lang.String thumbRemoteUrl)
      • getThumbnailImagePathByName

        public static java.lang.String getThumbnailImagePathByName​(java.lang.String filename)
      • getImageMaxSize

        public static int[] getImageMaxSize​(android.content.Context context)
        Get the maximum length and width of the picture
        参数:
        context -
      • showVideoThumb

        public static void showVideoThumb​(android.content.Context context,
                                          android.widget.ImageView imageView,
                                          io.agora.chat.ChatMessage message)
        Show video cover
        参数:
        context -
        imageView -
        message -
      • getImageShowSize

        public static android.view.ViewGroup.LayoutParams getImageShowSize​(android.content.Context context,
                                                                           io.agora.chat.ChatMessage message)
      • showImage

        public static void showImage​(android.content.Context context,
                                     android.widget.ImageView imageView,
                                     io.agora.chat.ChatMessage message)
        Show picture
        参数:
        context -
        imageView -
        message -
      • showImage

        public static void showImage​(android.content.Context context,
                                     android.widget.ImageView imageView,
                                     android.net.Uri imageUri,
                                     java.lang.String imageUrl,
                                     int imgWidth,
                                     int imgHeight)
        The logic of displaying pictures is as follows: 1. The width of the picture does not exceed 1/3 of the screen width, and the height does not exceed 1/2 of the screen width. In this case, the aspect ratio of the picture is 3:2 2. If the aspect ratio of the picture is greater than 3:2, select the height direction to be consistent with the regulations, and the width direction will be scaled proportionally 3. If the aspect ratio of the picture is less than 3:2, select the width direction to be consistent with the regulations, and the height direction is scaled proportionally 4. If the length and width of the picture are small, just display it according to the size of the picture 5. If there is no local resource, show the server address
        参数:
        context -
        imageView -
        imageUri - Picture local resources
        imageUrl - Server picture address
        imgWidth -
        imgHeight -
      • setDrawableSize

        public static void setDrawableSize​(android.widget.TextView textView,
                                           float defaultSize)
      • drawableToBitmap

        public static android.graphics.Bitmap drawableToBitmap​(android.graphics.drawable.Drawable drawable)
        Convert Drawable to Bitmap.
        参数:
        drawable -
        返回:
      • getRoundedCornerDrawable

        public static android.graphics.drawable.Drawable getRoundedCornerDrawable​(android.content.Context context,
                                                                                  android.graphics.Bitmap bitmap,
                                                                                  float cornerRadius)
        Get a drawable with corner radius.
        参数:
        context -
        bitmap -
        cornerRadius -
        返回: