private async Task CameraComponentCapture(MessageContainer data) { string imageBase64 = string.Empty; using (IRandomAccessStream stream = await CaptureMediaStream(ImageEncodingProperties.CreateJpeg()).ConfigureAwait(false)) { byte[] bytes = new byte[stream.Size]; using (DataReader reader = new DataReader(stream)) { await reader.LoadAsync((uint)stream.Size); reader.ReadBytes(bytes); } imageBase64 = Convert.ToBase64String(bytes); } data.AddValue("ImageBase64", imageBase64); await ComponentHandler.HandleOutput(data).ConfigureAwait(false); }
private async Task TurnTableComponentGet(MessageContainer data) { data.AddValue("Position", servo.Position); await ComponentHandler.HandleOutput(data).ConfigureAwait(false); }
private async Task CameraComponentGetCurrentFormat(MessageContainer data) { data.AddValue("MediaFormat", MediaPropertiesToJson(await GetCurrentFormat())); await ComponentHandler.HandleOutput(data).ConfigureAwait(false); }
private async Task ListenerGetPort(MessageContainer data) { data.AddValue("Port", this.port); await ComponentHandler.HandleOutput(data).ConfigureAwait(false); }
private async Task ListenerGetDataFormat(MessageContainer data) { data.AddValue("DataFormat", this.dataFormat.ToString()); await ComponentHandler.HandleOutput(data).ConfigureAwait(false); }