public void ReadOnlyStream() { using (var stream = File.OpenRead(Path.Combine(PathToImages, "baboon.png"))) using (var nonSeekable = new NonSeekableReadOnlyStream(stream)) using (var bitmap = SKBitmap.Decode(nonSeekable)) Assert.NotNull(bitmap); }
private Stream CreateNonSeekableReadOnlyStream(Stream stream, int bufferSize) { var nonSeekable = new NonSeekableReadOnlyStream(stream); var buffered = new SKFrontBufferedStream(nonSeekable, bufferSize); return(buffered); }
public void CanCreateFromNonSeekable() { using var stream = File.OpenRead(Path.Combine(PathToImages, "baboon.png")); using var nonSeekable = new NonSeekableReadOnlyStream(stream); using var data = SKData.Create(nonSeekable); Assert.NotNull(data); }
public void CanReadNonSeekableStream() { using (var stream = File.OpenRead(Path.Combine(PathToFonts, "Distortable.ttf"))) using (var nonSeekable = new NonSeekableReadOnlyStream(stream)) using (var typeface = SKTypeface.FromStream(nonSeekable)) { Assert.NotNull(typeface); } }
public void DownloadedStream() { var httpClient = new HttpClient(); using (var stream = httpClient.GetStreamAsync(new Uri("http://www.gstatic.com/webp/gallery/2.webp")).Result) using (var nonSeekable = new NonSeekableReadOnlyStream(stream)) using (var bitmap = SKBitmap.Decode(nonSeekable)) Assert.NotNull(bitmap); }
public void CanReadNonSeekableStream() { var fonts = SKFontManager.Default; using (var stream = File.OpenRead(Path.Combine(PathToFonts, "Distortable.ttf"))) using (var nonSeekable = new NonSeekableReadOnlyStream(stream)) using (var typeface = fonts.CreateTypeface(nonSeekable)) { Assert.NotNull(typeface); } }