question

newUser12345678909876543 avatar image
newUser12345678909876543 asked

How can i setup a background image for alexa show

We are actually working at a hackathon for a new alexa skill. Anyone know how can we setup a background image while running the skill at alexa show. Thank you in advance.

alexa skills kitecho showdisplay templates
10 |3000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Anand@Amazon avatar image
Anand@Amazon answered

Hello there,

Try to use below code:

const makeImage = Alexa.utils.ImageUtils.makeImage;

var bodyTemplateBuilder = new Alexa.templateBuilders.BodyTemplate7Builder();
var bodyTemplate = bodyTemplateBuilder.setBackgroundImage(makeImage(image));

if(this.event.context.System.device.supportedInterfaces.Display){
       this.response.speak('Render template!').renderTemplate(bodyTemplate);     
}
this.emit(':responseReady');
10 |3000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.