当前位置: 首页>>代码示例>>Java>>正文


Java ImageUtil.rotateBitmapInNeeded方法代码示例

本文整理汇总了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);
    }
}
 
开发者ID:newDeepLearing,项目名称:decoy,代码行数:17,代码来源:WatchSnapChatPictureActivity.java

示例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()));
}
 
开发者ID:newDeepLearing,项目名称:decoy,代码行数:25,代码来源:WatchMessagePictureActivity.java

示例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);
    }
}
 
开发者ID:newDeepLearing,项目名称:decoy,代码行数:17,代码来源:WatchMessagePictureActivity.java

示例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);
	}
}
 
开发者ID:newDeepLearing,项目名称:decoy,代码行数:23,代码来源:PickerAlbumPreviewActivity.java

示例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);
    }
}
 
开发者ID:netease-im,项目名称:NIM_Android_UIKit,代码行数:23,代码来源:PickerAlbumPreviewActivity.java

示例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()));
}
 
开发者ID:newDeepLearing,项目名称:decoy,代码行数:18,代码来源:WatchSnapChatPictureActivity.java


注:本文中的com.netease.nim.uikit.common.util.media.ImageUtil.rotateBitmapInNeeded方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。