internal static async Task <int> ReadAsync(this IInputStream stream, byte[] buffer, int offset, int count, CancellationToken cancellationToken) { var dst = new global::Windows.Storage.Streams.Buffer(new Memory <byte>(buffer, offset, count)); var read = await stream.ReadAsync(dst, (uint)count, InputStreamOptions.None).AsTask(cancellationToken); if (read != dst) { // Unfortunately the stream decided to not write data in the provided dst buffer. // We now have to copy the data. global::Windows.Storage.Streams.Buffer.Cast(read).CopyTo(0, buffer, offset, (int)read.Length); } return((int)read.Length); }
public void CS_WP_N_Activation() { var definition = new LumiaEffectDefinition(() => { return(new IFilter[] { new AntiqueFilter(), new FlipFilter(FlipMode.Horizontal) }); }); IBuffer buffer = new global::Windows.Storage.Streams.Buffer(10); var definition2 = new ShaderEffectDefinitionBgrx8(buffer); var definition3 = new ShaderEffectDefinitionNv12(buffer, buffer); }
public void CS_WP_N_Activation() { var definition = new LumiaEffectDefinition(() => { return new IFilter[] { new AntiqueFilter(), new FlipFilter(FlipMode.Horizontal) }; }); IBuffer buffer = new global::Windows.Storage.Streams.Buffer(10); var definition2 = new ShaderEffectDefinitionBgrx8(buffer); var definition3 = new ShaderEffectDefinitionNv12(buffer, buffer); }
private async void ViewFinder_OnTapped() { ImageEncodingProperties imageProperties = ImageEncodingProperties.CreateJpeg(); var stream = new InMemoryRandomAccessStream(); await captureManager.CapturePhotoToStreamAsync(imageProperties, stream); _bitmap = new WriteableBitmap(300, 300); stream.Seek(0); await _bitmap.SetSourceAsync(stream); stream.Seek(0); var buffer = new global::Windows.Storage.Streams.Buffer((uint)stream.Size); stream.ReadAsync(buffer, (uint)stream.Size, InputStreamOptions.None); await captureManager.StopPreviewAsync(); }
public unsafe void CS_WP_N_BufferExtension() { var buffer = new global::Windows.Storage.Streams.Buffer(10); byte *data = buffer.GetData(); }
public unsafe void CS_WP_N_BufferExtension() { var buffer = new global::Windows.Storage.Streams.Buffer(10); byte* data = buffer.GetData(); }
internal static Task WriteAsync(this IOutputStream stream, byte[] buffer, int offset, int count, CancellationToken cancellationToken) { var src = new global::Windows.Storage.Streams.Buffer(new Memory <byte>(buffer, offset, count)); return(stream.WriteAsync(src).AsTask(cancellationToken)); }