> We can get the binary image with the header
> when the next code we get the binary image:
> <?php
> header("Content-type: image/jpeg");
> print createImagenFunction();
> ?>
>
> I get the binary with qx.io.remote.Request
>
> but we don't know what to do in QOOXDOO, we need to know how to insert
> this code in qooxdoo to see the image if that is posible.
>   

Indeed, you can receive the image data alright, but it's no use in your 
JS code. There is not much you can do with the data currently. On the 
other hand, image objects just take URLs to get the image into the DOM.

So I think you have to do two steps, instead of one:
1) generate the image with a POST request, but leave it on the server 
and just return the URL to it
2) use this URL as the source attribute in an image object

T.

> Grettings
> insulae
>
> 2009/9/29 Petr Kobalíček <[email protected]>:
>   
>> Hi,
>>
>> I'm afraid that this is not possible using POST. There is responseType
>> property in Request class that says:
>>
>> responseType
>>
>> Response type of request.
>>
>> The response type is a MIME type, default is text/plain. Other
>> supported MIME types are text/javascript, text/html, application/json,
>> application/xml.
>> Allowed values:
>> "text/plain", "text/javascript", "application/json",
>> "application/xml", "text/html"
>> Init value:
>> "text/plain"
>>
>> So these types of requests are probably not for binary data transfer
>> (I don't know if overriding the property could help). I think that
>> your first way is way to go. How many parameters you need that URL is
>> not enough for you?
>>
>> - Petr
>>
>> 2009/9/29 Alejandro Paz <[email protected]>:
>>     
>>> I want to know how can i load a image to my qooxdoo Widget.
>>> The image is remotely generated with a certain parameters send to PHP (PHP
>>> generated the image).
>>> I have a way to generate the image and its work, but i want to do it a
>>> better way.
>>>
>>> *The working way is:
>>> Example:
>>> var params1 = "&params1=png";
>>> var params2 = "&params2=120";
>>> var img = new qx.ui.basic.Imagen("http://localhost/genImg.php?style=graph"; +
>>> params1 + params2");
>>>
>>> like i said this example works, but i need to send more complex data in json
>>> format.
>>>
>>> *The new way but with error:
>>> I used the object qx.io.remote.Request
>>> Example:
>>> var params = new Object();
>>> params.type = "png";
>>> params.width = 120;
>>> var ajax = new qx.io.remote.Request("genImg.php", "POST");
>>> ajax.setRequestHeader("Content-Type", "application/json");
>>> ajax.addListener("completed", function (e)
>>> {
>>>        alert(e.getContent());
>>> }, this);
>>> ajax.setData(qx.util.Json.stringify(params));
>>> ajax.setAsynchronous(false);
>>> ajax.send();
>>>
>>> This return the image binary code, but i don't know how i can show it.
>>> Thanks for your help like always.
>>>
>>> ------------------------------------------------------------------------------
>>> Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
>>> is the only developer event you need to attend this year. Jumpstart your
>>> developing skills, take BlackBerry mobile applications to market and stay
>>> ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
>>> http://p.sf.net/sfu/devconf
>>> _______________________________________________
>>> qooxdoo-devel mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>>
>>>
>>>       
>> ------------------------------------------------------------------------------
>> Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
>> is the only developer event you need to attend this year. Jumpstart your
>> developing skills, take BlackBerry mobile applications to market and stay
>> ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
>> http://p.sf.net/sfu/devconf
>> _______________________________________________
>> qooxdoo-devel mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>
>>     
>
>
>
>   

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to