//CHANGED public async Task SetImageRawAsync(string context, string imgString, string extension = "png") { var args = new SetImageArgs { context = context, payload = new SetImageArgs.Payload { TargetType = SetTitleArgs.TargetType.HardwareAndSoftware, image = $"data:image/{extension};base64, {imgString}" } }; await _proxy.SendStreamDeckEvent(args); }
public async Task SetImageAsync(string context, string imageLocation) { var imgString = Convert.ToBase64String(File.ReadAllBytes(imageLocation), Base64FormattingOptions.None); var args = new SetImageArgs { context = context, payload = new SetImageArgs.Payload { TargetType = SetTitleArgs.TargetType.HardwareAndSoftware, image = $"data:image/{new FileInfo(imageLocation).Extension.ToLowerInvariant().Substring(1)};base64, {imgString}" } }; await _Proxy.SendStreamDeckEvent(args); }