Javascript 来自ajax请求的Extjs图像/png

Javascript 来自ajax请求的Extjs图像/png,javascript,ajax,image,extjs,Javascript,Ajax,Image,Extjs,大家好,我正在开发一个在服务器上显示动态生成的图像的应用程序。在本例中,为了获取图像png,应用程序使用Ajax请求。检索到的数据如下所示: "�PNG IHDRLXx�s sBIT|d� pHYsaa�?�i IDATx���w|U�����~�{BI(�H/�4AaeQQp�>�n�]Wݯ�"�W?~t���uuW]�""R)RBI ����w~�;)7 Iя�................................. .............

大家好,我正在开发一个在服务器上显示动态生成的图像的应用程序。在本例中,为了获取图像png,应用程序使用Ajax请求。检索到的数据如下所示:

    "�PNG


    IHDRLXx�s
    sBIT|d� pHYsaa�?�i IDATx���w|U�����~�{BI(�H/�4AaeQQp�>�n�]Wݯ�"�W?~t���uuW]�""R)RBI ����w~�;)7   Iя�.................................
..........................................."
这看起来像:

在我的应用程序中,我有一个Text:image,我想在其中显示图像,但我不知道怎么做。有人知道怎么做吗

下面是ajax请求代码

Ext.Ajax.request({
url: 'http://localhost/my_url/you_dont_need_to_know_this',
success: function(response){                
    //img.setData(response.responseText); //img is a Ext:image component.
    debugger;
},
scope: this

}))

如果服务器响应图像数据,请执行以下操作:

Ext.Ajax.request({
    binary: true,  //set binary to true
    url: 'http://localhost/my_url/you_dont_need_to_know_this',
    success: function(response) {
        var blob = new Blob([response.responseBytes], {type: 'image/png'}),
        url = window.URL.createObjectURL(blob),
        img = document.createElement('img');
        img.src = url;

        //do something with img
    }
});

如果服务器响应图像数据,请执行以下操作:

Ext.Ajax.request({
    binary: true,  //set binary to true
    url: 'http://localhost/my_url/you_dont_need_to_know_this',
    success: function(response) {
        var blob = new Blob([response.responseBytes], {type: 'image/png'}),
        url = window.URL.createObjectURL(blob),
        img = document.createElement('img');
        img.src = url;

        //do something with img
    }
});

您的ajax请求看起来像什么。。?你能给我们看看你的代码吗?你的ajax请求是什么样子的。。?你能给我们看一下你的代码吗。。。