类 EaseImageUtils
- java.lang.Object
-
- io.agora.util.ImageUtils
-
- io.agora.chat.uikit.utils.EaseImageUtils
-
public class EaseImageUtils extends io.agora.util.ImageUtils
-
-
构造器概要
构造器 构造器 说明 EaseImageUtils()
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static android.graphics.BitmapdrawableToBitmap(android.graphics.drawable.Drawable drawable)Convert Drawable to Bitmap.static int[]getImageMaxSize(android.content.Context context)Get the maximum length and width of the picturestatic java.lang.StringgetImagePath(java.lang.String remoteUrl)static java.lang.StringgetImagePathByFileName(java.lang.String filename)static android.view.ViewGroup.LayoutParamsgetImageShowSize(android.content.Context context, io.agora.chat.ChatMessage message)static android.graphics.drawable.DrawablegetRoundedCornerDrawable(android.content.Context context, android.graphics.Bitmap bitmap, float cornerRadius)Get a drawable with corner radius.static java.lang.StringgetThumbnailImagePath(java.lang.String thumbRemoteUrl)static java.lang.StringgetThumbnailImagePathByName(java.lang.String filename)static voidsetDrawableSize(android.widget.TextView textView, float defaultSize)static voidshowImage(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 voidshowImage(android.content.Context context, android.widget.ImageView imageView, io.agora.chat.ChatMessage message)Show picturestatic voidshowVideoThumb(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
-
-
-
-
方法详细资料
-
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 resourcesimageUrl- Server picture addressimgWidth-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-- 返回:
-
-