コード例 #1
0
        public async Task DownloadAndEncodeImage()
        {
            OvrStreamConnection connection = new OvrStreamConnection(OvrStreamWebSocketAddress);
            await connection.ConnectAsync(CancellationToken.None);

            var path = await connection.DownloadImageAsync(new Uri("https://pbs.twimg.com/profile_images/912736926125264896/0MYdjgqN_400x400.jpg"), CancellationToken.None);

            Assert.IsNotNull(path);
            Assert.Greater(path.Length, 0);

            var imageBase64 = await connection.EncodeImageAsync(path, CancellationToken.None);

            Assert.IsNotNull(imageBase64);
            Assert.Greater(imageBase64.Length, 0);

            await connection.DisconnectAsync(CancellationToken.None);
        }