Hello,
How can I do it?
In context of InfoWindow
<img src=\"${Photo}\" />
not work...
What is the value of the "Photo" field? Is it a url? Is it a base64 encoded string?
If you could provide a sample that may help.
no, it is type "Raster" in ArcGIS.
in the REST I see this field as esriFieldTypeBlob. I found sample:
<img src="data:image/png;base64,${Photo}" />
but image not display
You would need to convert your raster Blob data to base64 before you apply it to the image src as Rene suggests.
One way I have seen to do this on the client side is using the HTML5 canvas object. For example: javascript - How to get the right image data in base64 format using HTML5 canvas - Stack Overflow
Another option may be using the Dojo toolkit: dojox.encoding.base64 — The Dojo Toolkit - Reference Guide
(info from this post: How to read FieldTypeBlob from graphic.attributes).
Using the HTML5 canvas object will have compatibility issues with older browsers.
Encoding the Blob to base64 server-side is relatively simple but it looks like you need to do this on the client.
I read this post How to read FieldTypeBlob from graphic.attributes and I try this, but image not display (I wrote this above)
May be I define dojox incorect?
require([..., "dojox/encoding/base64", ...],
function (..., base64, ...) {}
Oh, no... I was wrong... field type is esriFieldTypeRaster