I'm using the latest version of the javascript api and I have a use case where an outline of the selected polygon is to be displayed in a popup...not an esri popup tough. thanks.
Tilovon,
Sounds like you want to use the views screenshot capability.
https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#takeScreenshot