gpt4 book ai didi

Android - AQuery 在回调方法上获取图像

转载 作者:行者123 更新时间:2023-11-29 21:13:12 25 4
gpt4 key购买 nike

您好,我有一个请求 URL(Google Places 请求 URL),我得到的响应是一张图片。如何在回调函数中获取图像?

更新

AQuery aQuery = new AQuery(getApplicationContext());
String urlString = "https://maps.googleapis.com/maps/api/place/photo?maxwidth=400&photoreference=CnRoAAAAGJs3jtWR_Dm_lQSan6ha40TR2IKPlqbLQ5-slSCxPJJIksM2GmiEhqBtmhtdu9_njLxvFMyTMz-e_FoDIZuKmoS65Uc1AeD4kWjrJ4SwEjgT4ac-KtfNaX4Lg0FOqJRCN33ylJikCF29bgqKCcNUQxIQ0OvXpGXfUT3ADICQqP_QOhoUBlByoB4FKPp1woIKVb2Z01bblrw&sensor=true&key=AIzaSyB-tx7MBOQk4qya_vnmwHlQDao-SufKuBw";

aQuery.ajax(urlString, String.class, new AjaxCallback<String>(){
@Override
public void callback(String url, String content, AjaxStatus

//Here "content" is the response that I'm getting. Currently I'm getting this as a String I don't know how to get it as a image

}
});

最佳答案

像这样:

final AjaxCallback<Bitmap> cb = new AjaxCallback<Bitmap>() {
@Override
public void callback(String url, Bitmap bm, AjaxStatus status) {
// do whatever you want with bm (the image)
}
};
final AQuery aq = new AQuery(ctx);
aq.ajax(url, Bitmap.class, 0, cb);

关于Android - AQuery 在回调方法上获取图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22161091/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com