×

BufferImageSource Class

An image source created from a compressed image buffer.

Inheritance Hierarchy

System..::..Object  Nokia.Graphics.Imaging..::..BufferImageSource

Namespace: Nokia.Graphics.ImagingAssembly: Nokia.Graphics.Imaging (in Nokia.Graphics.Imaging.dll) Version: 255.255.255.255

Syntax

C#
public sealed class BufferImageSource : IClosable, 
	IImageProvider, __IBufferImageSourcePublicNonVirtuals
Visual Basic
Public NotInheritable Class BufferImageSource 
	Implements IClosable, IImageProvider, __IBufferImageSourcePublicNonVirtuals
Visual C++
public ref class BufferImageSource sealed : IClosable, 
	IImageProvider, __IBufferImageSourcePublicNonVirtuals

Examples

C#

This sample takes CameraCaptureTask result photo, creates a StreamImageSource out of it and applies a filter.

async void PhotoCapture_Completed(object sender, PhotoResult e)
{
    var stream = new MemoryStream();
    e.ChosenPhoto.CopyTo(stream);
    
    using (var source = new BufferImageSource(stream.GetWindowsRuntimeBuffer()))
    {
        var target = new WriteableBitmap((int)ImageControl.ActualWidth, (int)ImageControl.ActualHeight);

        // Create a new renderer which outputs WriteableBitmaps
        using (var renderer = new WriteableBitmapRenderer(source, target))
        {
            // Render the image
            await renderer.RenderAsync();

            // Set the output image to Image control as a source
            ImageControl.Source = target;
        }
    }
}
Visual Basic


Visual C++



Last updated 19 June 2014

Back to top

×