makeImageRequest not responding

Trying to use the new makeImageRequest function implemented as part of SDK 1.2.0, fetching a simple png image (256x256 pixels). I get no error message. However, function in responseCallback is never called. Also strange is that the quick-tip in Eclipse says makeImageRequest take three parameters, whereas the documentation online talks about four.

Comm.makeImageRequest("http://adress.png", {}, method(:onReceive));

(In a browser the picture is shown without problems)

Anyone who has made this work?
  • Are you able to call methods on the BitmapResource as indicated by CROWZ187? You should definitely be able to call those methods and get actual data back from them. If they don't work then a bug needs to be filed.


    Hello,
    Methods work properly:

    function onReceiveImage(responseCode, data)
    {
    if(responseCode==200)
    {
    if(data instanceof Ui.BitmapResource)
    {
    System.println("IMAGE OK");
    bitmap=data;

    System.println("H="+data.getHeight());
    System.println("W="+data.getWidth());
    System.println("Data="+data.toString());
    Ui.requestUpdate();
    }
    }

    System.println("END ResponseCode=="+responseCode);
    }


    The output is :
    IMAGE OK
    H=200
    W=200
    Data=Bitmap 200 x 200
    END ResponseCode==200
  • Here are my findings:

    1)
    - the simulator invokes "Invalid Resource" on at least some images. Maybe it has something to do with the palette, I have not tested yet.
    - on the watch (F3 V6.52 beta) itself it works nevertheless great.
    2)
    - with an image of 200x200 px i get a "-402" error (NETWORK_RESPONSE_TOO_LARGE ) as resonseCode in onReceiveImage(resonseCode, data)
    - this works on the watch, too! No problems here!

    So everybody with problems in the emulator: it is worth playing arround with the palette, or just try it on the watch.

    Thany you all for your constructive answers!