Skip to content

Instantly share code, notes, and snippets.

@krabs-github
Last active July 26, 2021 19:30
Show Gist options
  • Save krabs-github/a8b6200d73d65fabb47ba52207c85f0b to your computer and use it in GitHub Desktop.
Save krabs-github/a8b6200d73d65fabb47ba52207c85f0b to your computer and use it in GitHub Desktop.
[Set Image Function Sample] setImage function sample #Public #Streamdeck
// Variables beginning with "v" are the variables you define prior to calling the function.
// The Function
function setImage (context, vBase64img) {
var json = {
'event': 'setImage',
'context': context,
'payload': {
'image': vBase64img,
'target': DestinationEnum.HARDWARE_AND_SOFTWARE
}
};
//console.log("setImage: ", vBase64img)
websocket.send(JSON.stringify(json));
}
// The image we want to send to the streamdeck key
vBase64img = "resources/myimage.png";
// Call the function
setImage(context, vBase64img);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment