- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我必须在 ImageView 中以 json 格式显示从服务器获取的图像。但是我得到的不是图片网址,而是很多这样的字符..
����JFIF��C
$.' ",#(7),01444'9=82<.342��C
2!!22222222222222222222222222222222222222222222222222����"��
���}!1AQa"q2���#B��R��$3br�
%&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz�����
我猜这是图像的原始数据或 JFIF。我搜索了 stackoverflow,但只能找到从 base64 转换,或显示来自 url 的图像。
如何从中获取图像并将其显示在 ImageView 中。
问候。
最佳答案
我不必将响应转换为 Base64。只是将其转换为位图并将其设置为 ImageView。由于我缺乏知识,这是一个非常愚蠢的问题。希望我的代码对以后的人有帮助
HttpClient httpClient = ServiceHelper.getHttpClient();
HttpContext localContext = new BasicHttpContext();
HttpGet httpGet = new HttpGet(RestApiPaths.GET_PROFILE_PICTURE);
try {
HttpResponse response = httpClient.execute(httpGet);
int statusCode = response.getStatusLine().getStatusCode();
final HttpEntity entity = response.getEntity();
if (entity != null) {
InputStream inputStream = null;
try {
inputStream = entity.getContent();
final Bitmap bitmap = BitmapFactory.decodeStream(inputStream);
imageView.setImageBitmap(emergencyCardPhoto);
} finally {
if (inputStream != null) {
inputStream.close();
}
entity.consumeContent();
}
}
}
catch(ClientProtocolException e){
e.printStackTrace();
}
catch (IOException e){
e.printStackTrace();
}
关于Android,json 中的 JFIF responseText - ImageView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30302658/
我对 tensorflow 很陌生,我想清楚地知道,下面的命令有什么作用? import tensorflow as tf from tensorflow import keras from tens
我需要找到JPEG(JFIF)图像的大小。该图像不会保存为独立文件,因此我不能使用GetFileSize或任何其他API这样的图像(该图像放置在流中,并且不存在其他 header ,但通常的JPEG
所以我正在从文件中读取 JFIF (JPEG) 数据,作为练习(我知道已经有一些库可以做到这一点,我不是在寻找那些库)。我已经获得了图像文件大小、颜色深度和尺寸。但是,我不太确定如何获取实际的图像数据
我想为自己(或者如果效果不错的话,可以为他人)做一个工具,用于低级检查/修改JPEG文件。有点像TweakPNG,但用于JPEG。到目前为止,我还没有找到可以执行此操作的工具。 为此,我需要阅读所有相
我需要将 jpeg 图像转换为 jfif 格式,这是因为我需要发送彩信数据。谁能告诉我如何使用java转换它。 最佳答案 你尝试过ImageIO吗?我真的不知道它是否有效,而且我现在无法测试它(因为我
我有一个允许用户上传图片的 laravel 项目,我可以毫无问题地验证 (jpeg/png)。当用户上传 JFIF 图像(被认为是图像/jpeg mime 类型)但 laravel 干预包显示消息“不
在 JPEG 文件中,exif 元数据是否总是存储为第一个标记?或者它可以在其他标记之间? 下面有一个注释“在APP1 Marker区域之后,其他JPEG Markers在后面”。 http://ww
我正在尝试使用 Python 更新 JPEG 文件中嵌入的 JFIF 缩略图。 这是应该实现此目的的(有点hackish)方法: def set_thumbnail(self, data):
我必须在 ImageView 中以 json 格式显示从服务器获取的图像。但是我得到的不是图片网址,而是很多这样的字符.. ����JFIF��C $.' ",#(7),
致力于从我使用 Java 创建的 JFIF 图像中收集信息: Image bmp = ImageIO.read(new File("Background1.png")) .getSca
Active Directory 可以根据 jpegPhoto Attribute definition 以 JPEG 文件交换格式 (JFIF) 存储图像。 .我想使用它,但我从未听说过 JFIF。
我已经创建了一个 C++ 结构来读取和验证 JFIF 文件格式的 header 。结构如下... #pragma pack(1) typedef struct _JFIF_Header { W
我试图从头到尾寻找答案。这看起来很简单,但我缺乏 Javascript 知识(一直用 Java 编码),再加上 Javascript 端的图像流转换,这让这很难。 我创建了一个 REST 请求 url
我是一名优秀的程序员,十分优秀!