My WinRT XAML page loads an image from a file asset like this:
Image img = new Image(); // Windows.UI.Xaml.Controls.Image
BitmapImage bmp = new BitmapImage(new Uri(Page.BaseUri, "Assets/myImage.png"));
img.Source = bmp;
So far so good. Now, at a later time, I’d like to do some transformations such as resizing and cropping.
It looks like this can be done using BitmapEncoder and BitmapTransform, but will require reading and writing to disk – in particular, writing out the modified image to a new file.
Since my app does potentially do many transformations, I’d prefer to do this in memory without any disk I/O but can’t figure out how.
Any ideas?
Have a look at the
WriteableBitmapclass, this allows modifications in memory.More infomation can be found here:
http://msdn.microsoft.com/en-us/library/windows/apps/BR243259