[Feature Request] API for rendering an adaptive card to an image
See original GitHub issueIssue Description
Adaptive cards are still not completely supported in e.g. Cortana, Skype and Teams. A roadmap is not really around. So adapting the Adaptive Card technology/standard is impeded, because people cannot bring their already existing adaptive card implementations to those platforms. Thus, people are stopped form releasing features.
Instead of waiting for Adaptive Cards being completely supported by a platform, we can simply use images: An adaptive card could be rendered to an image that can be used in conversation messages on channels that are not (yet) supporting adaptive cards or even in all new channels that will appear in the future.
Rendering cards to an image is shown in the WPFVisualizer sample (https://github.com/Microsoft/AdaptiveCards/tree/master/source/dotnet/Samples/WPFVisualizer). But this is specific to WPF and does not work properly in other scenarios (based on WPF, so you have to deploy it, e.g. with a bot implementation).
Feature Request
We need a utility service that renders an adaptive card to an image. Only a simple default design is needed, e.g. the card design of WebChat. The service works async and returns at least a byte stream of the image.
Code Example
var hostConfig = new AdaptiveHostConfig()
{
SupportsInteractivity = false
};
var renderer = new AdaptiveCardRenderer(hostConfig)
{
// Set defined resources here.
Resources = new ResourceDictionary()
};
Stream pngImageStream = await renderer.RenderToImageAsync(parseResult.Card);
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (3 by maintainers)
Top GitHub Comments
@matthidinger @ejadib I felt free to create issue #1012 for the NodeJS implementation. Hope that’s ok. Could you please provide your results of package evaluation?
@ejadib there isn’t such a thing at this time, but I was doing some research and it seems like there are quite a few node packages that would enable it. I don’t have time to really investigate it right now but I’d be more than happy to review/integrate a PR if someone got it going