本文整理汇总了Java中com.netease.nim.uikit.common.util.media.ImageUtil.rotateBitmapInNeeded方法的典型用法代码示例。如果您正苦于以下问题:Java ImageUtil.rotateBitmapInNeeded方法的具体用法?Java ImageUtil.rotateBitmapInNeeded怎么用?Java ImageUtil.rotateBitmapInNeeded使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.netease.nim.uikit.common.util.media.ImageUtil
的用法示例。
在下文中一共展示了ImageUtil.rotateBitmapInNeeded方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setImageView
import com.netease.nim.uikit.common.util.media.ImageUtil; //导入方法依赖的package包/类
private void setImageView(final IMMessage msg) {
String path = ((SnapChatAttachment) msg.getAttachment()).getPath();
if (TextUtils.isEmpty(path)) {
image.setImageBitmap(ImageUtil.getBitmapFromDrawableRes(getImageResOnLoading()));
return;
}
Bitmap bitmap = BitmapDecoder.decodeSampledForDisplay(path, false);
bitmap = ImageUtil.rotateBitmapInNeeded(path, bitmap);
if (bitmap == null) {
Toast.makeText(this, R.string.picker_image_error, Toast.LENGTH_LONG).show();
image.setImageBitmap(ImageUtil.getBitmapFromDrawableRes(getImageResOnFailed()));
} else {
image.setImageBitmap(bitmap);
}
}
示例2: setThumbnail
import com.netease.nim.uikit.common.util.media.ImageUtil; //导入方法依赖的package包/类
/**
* ******************************** 设置图片 *********************************
*/
private void setThumbnail(IMMessage msg) {
String thumbPath = ((ImageAttachment) msg.getAttachment()).getThumbPath();
String path = ((ImageAttachment) msg.getAttachment()).getPath();
Bitmap bitmap = null;
if (!TextUtils.isEmpty(thumbPath)) {
bitmap = BitmapDecoder.decodeSampledForDisplay(thumbPath);
bitmap = ImageUtil.rotateBitmapInNeeded(thumbPath, bitmap);
} else if (!TextUtils.isEmpty(path)) {
bitmap = BitmapDecoder.decodeSampledForDisplay(path);
bitmap = ImageUtil.rotateBitmapInNeeded(path, bitmap);
}
if (bitmap != null) {
image.setImageBitmap(bitmap);
return;
}
image.setImageBitmap(ImageUtil.getBitmapFromDrawableRes(getImageResOnLoading()));
}
示例3: setImageView
import com.netease.nim.uikit.common.util.media.ImageUtil; //导入方法依赖的package包/类
private void setImageView(final IMMessage msg) {
String path = ((ImageAttachment) msg.getAttachment()).getPath();
if (TextUtils.isEmpty(path)) {
image.setImageBitmap(ImageUtil.getBitmapFromDrawableRes(getImageResOnLoading()));
return;
}
Bitmap bitmap = BitmapDecoder.decodeSampledForDisplay(path, false);
bitmap = ImageUtil.rotateBitmapInNeeded(path, bitmap);
if (bitmap == null) {
Toast.makeText(this, R.string.picker_image_error, Toast.LENGTH_LONG).show();
image.setImageBitmap(ImageUtil.getBitmapFromDrawableRes(getImageResOnFailed()));
} else {
image.setImageBitmap(bitmap);
}
}
示例4: setImageView
import com.netease.nim.uikit.common.util.media.ImageUtil; //导入方法依赖的package包/类
public void setImageView(PhotoInfo info) {
if (info == null) {
return;
}
if(info.getAbsolutePath() == null){
return;
}
Bitmap bitmap = BitmapDecoder.decodeSampledForDisplay(info.getAbsolutePath());
if (bitmap == null) {
currentImageView.setImageBitmap(ImageUtil.getDefaultBitmapWhenGetFail());
Toast.makeText(this, R.string.picker_image_error, Toast.LENGTH_LONG).show();
} else {
try{
bitmap = ImageUtil.rotateBitmapInNeeded(info.getAbsolutePath(), bitmap);
} catch (OutOfMemoryError e) {
e.printStackTrace();
}
currentImageView.setImageBitmap(bitmap);
}
}
示例5: setImageView
import com.netease.nim.uikit.common.util.media.ImageUtil; //导入方法依赖的package包/类
public void setImageView(PhotoInfo info) {
if (info == null) {
return;
}
if (info.getAbsolutePath() == null) {
return;
}
Bitmap bitmap = BitmapDecoder.decodeSampledForDisplay(info.getAbsolutePath());
if (bitmap == null) {
currentImageView.setImageBitmap(ImageUtil.getDefaultBitmapWhenGetFail());
Toast.makeText(this, R.string.picker_image_error, Toast.LENGTH_LONG).show();
} else {
try {
bitmap = ImageUtil.rotateBitmapInNeeded(info.getAbsolutePath(), bitmap);
} catch (OutOfMemoryError e) {
e.printStackTrace();
}
currentImageView.setImageBitmap(bitmap);
}
}
示例6: setThumbnail
import com.netease.nim.uikit.common.util.media.ImageUtil; //导入方法依赖的package包/类
/**
* ******************************** 设置图片 *********************************
*/
private void setThumbnail() {
String path = ((SnapChatAttachment) message.getAttachment()).getThumbPath();
if (!TextUtils.isEmpty(path)) {
Bitmap bitmap = BitmapDecoder.decodeSampledForDisplay(path);
bitmap = ImageUtil.rotateBitmapInNeeded(path, bitmap);
if (bitmap != null) {
image.setImageBitmap(bitmap);
return;
}
}
image.setImageBitmap(ImageUtil.getBitmapFromDrawableRes(getImageResOnLoading()));
}