项目里要展示CT片子照片 怎么把DICOM医学图像并转换成JPG图像啊?急!在线等
1条回答 默认 最新
- ProXin 2015-12-31 02:38关注
可以将图片内容见喜成字节数组,然后将字节数组转换为图像
public static Bitmap bytes2Bimap(byte[] b) {
if (b != null && b.length != 0) {
return BitmapFactory.decodeByteArray(b, 0, b.length);
} else {
Log.i("----------------", "获取图片");
return null;
}
}public static byte[] bitmap2Bytes(Bitmap bm) { byte [] bs = null; if(bm != null){ ByteArrayOutputStream baos = new ByteArrayOutputStream(); bm.compress(Bitmap.CompressFormat.JPEG, 100, baos); bs = baos.toByteArray(); } return bs; }
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报