Displaying PNG images returned by an API
Hi,
I have a service in my app that invokes an API which returns an image (.png) as a byte array. I have tested it in a browser and it displays properly. But I'm not able to link that to an image component in my app.
I have tried to return the byte array as a json. The structure of the json is
[ { "graph" : [ .... ] } ].
The response from the service shows up as
$ - $ - graph - graph.
I've tried linking $ or graph to the image asset but neither worked. I have also tried to return an svg+xml from the API. But again, I didn't know how to link the response values to the image asset. Is there any tutorial on working with images returned by APIs. The weather app which is the only relevant tutorial I could find has an API that returns an image as a URL, which is not applicable in my case. For example
"weatherIconUrl": [ { "value": "http:\/\/cdn.worldweatheronline.net\/images\/wsymbols01_png_64\/wsymbol_0004_black_low_cloud.png" } ]
Appreciate your help. Thanks
Satya