After you created a new Project and installed Nokia Imaging SDK , copy an paste codes below.

You will see two ApplicationBarButton , do not forget change rotation as a Landscape.

<!–LayoutRoot is the root grid where all page content is placed–>
<Grid x:Name=”LayoutRoot” Background=”Transparent”>
<RowDefinition Height=”Auto”/>
<RowDefinition Height=”*”/>
<!–Original and Filtered Images–>
<Grid x:Name=”ContentPanel” Grid.Row=”1″>
<ImageBrush Stretch=”Fill” ImageSource=”/resimler/wallpaper22.jpg”/>
<Image Name=”beray1″ HorizontalAlignment=”Left” Height=”470″ Margin=”10,0,0,0″ VerticalAlignment=”Top” Width=”350″ />
<Image Name=”beray2″ HorizontalAlignment=”Left” Height=”468″ Margin=”365,2,0,0″ VerticalAlignment=”Top” Width=”349″/>
<shell:ApplicationBar IsVisible=”True” IsMenuEnabled=”False” BackgroundColor=”Black” Opacity=”0.7″ ForegroundColor=”White”>
<shell:ApplicationBarIconButton IconUri=”/resimler/Folder.png” x:Name=”gallerybutton” Text=”Open” Click=”ApplicationBarIconButton_Click”/>
<shell:ApplicationBarIconButton IconUri=”/resimler/Save.png” x:Name=”savebutton” Text=”Save” Click=”ApplicationBarIconButton_Click_1″/>



Now you must add codes below to your MainPage.cs page. With these codes , you will be able to pick an image , save and use filter.

At the first , copy replace codes below ;

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using abc.Resources;(Replace abc with your Project name)
using System.Windows.Media.Imaging;
using Nokia.Graphics.Imaging;
using Microsoft.Phone.Tasks;
using System.IO;
using System.Runtime.InteropServices.WindowsRuntime;
using Nokia.InteropServices.WindowsRuntime;
using Windows.Storage.Streams;
using Microsoft.Xna.Framework.Media;

If there is no error , continue to copy and paste.

privateFilterEffect ketch = null;
//We’ve createad two writeable bitmap image to be able to use filter
privateWriteableBitmap beray1bitmap = null;
privateWriteableBitmap beray2bitmap = null;

public MainPage()


beray1bitmap = newWriteableBitmap((int)beray1.Width, (int)beray1.Height);
beray2bitmap = newWriteableBitmap((int)beray2.Width, (int)beray2.Height);


privatevoid ApplicationBarIconButton_Click(object sender, EventArgs e)

PhotoChooserTask chooser = newPhotoChooserTask();
chooser.Completed += PickImageCallback;
privateasyncvoid PickImageCallback(object sender, PhotoResult e)
if (e.TaskResult != TaskResult.OK || e.ChosenPhoto == null)
beray1.Source = beray1bitmap;
// Rewind stream to start.           

e.ChosenPhoto.Position = 0;
var imageStream = newStreamImageSource(e.ChosenPhoto);
sketch = newFilterEffect(imageStream);
var sketchfilter = newSketchFilter();
sketch.Filters = new[] { sketchfilter };
// Render the image to a WriteableBitmap.
var renderer = newWriteableBitmapRenderer(sketch, beray2bitmap);
beray2bitmap = await renderer.RenderAsync();
beray2.Source = beray2bitmap;
catch (Exception exception)
privateasyncvoid ApplicationBarIconButton_Click_1(object sender, EventArgs e)
if (sketch == null)
var jpegRenderer = newJpegRenderer(sketch);
// Jpeg renderer gives the raw buffer for the filtered image.
IBuffer jpegOutput = await jpegRenderer.RenderAsync();
// Save the image as a jpeg to the saved pictures album.
MediaLibrary library = newMediaLibrary();
string fileName = string.Format(“BerayEfekt_{0:G}”, DateTime.Now);
var picture = library.SavePicture(fileName, jpegOutput.AsStream());
MessageBox.Show(“Image Saved”);
Everything’s fine run and the results of the Project :


Additionally , you can download Project by clicking here

> Windows Phone 8 – 8.1 hakkında daha fazla yazı için: Tıklayın.  <'da yayımladığımız yazılardan haberdar olmak için mail adresin ile tek tıkla abone olabilirsin.

Diğer 10321 aboneye katılın

e-posta adresiniz: Protection Status

Bumerang - Yazarkafe