×

ReframingFilter Class

Reframes the image to comprise a rectangle of any size inside or outside the current image. Reframing is done by specifying a reframing area by position and size, an angle of clockwise rotation, and a pivot point around which the reframing area is rotated.

Inheritance Hierarchy

System..::..Object  Nokia.Graphics.Imaging..::..ReframingFilter

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

Syntax

C#
public sealed class ReframingFilter : IFilter, 
	__IReframingFilterPublicNonVirtuals
Visual Basic
Public NotInheritable Class ReframingFilter 
	Implements IFilter, __IReframingFilterPublicNonVirtuals
Visual C++
public ref class ReframingFilter sealed : IFilter, 
	__IReframingFilterPublicNonVirtuals

Examples

C#

This sample takes CameraCaptureTask result photo and applies a filter to it.

async void CaptureTask_Completed(object sender, PhotoResult e)
{
    // Create a source to read the image from PhotoResult stream
    using (var source = new StreamImageSource(e.ChosenPhoto))
    {
        // Create effect collection with the source stream
        using (var filters = new FilterEffect(source))
        {
            e.ChosenPhoto.Position = 0;

            // Query the image size
            var myBitmapImage = new BitmapImage();
            myBitmapImage.SetSource(e.ChosenPhoto);
            var area = new Windows.Foundation.Rect(0, 0, myBitmapImage.PixelWidth, myBitmapImage.PixelHeight);

            // Initialize the filter
            var sampleFilter = new ReframingFilter(area, 30, new Windows.Foundation.Point(0.5, 0.5));

            // Add the filter to the FilterEffect collection
            filters.Filters = new IFilter[] { sampleFilter };

            // Create a target where the filtered image will be rendered to
            var target = new WriteableBitmap((int)ImageControl.ActualWidth, (int)ImageControl.ActualHeight);

            // Create a new renderer which outputs WriteableBitmaps
            using (var renderer = new WriteableBitmapRenderer(filters, target))
            {
                // Render the image with the filter(s)
                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

×