Hi, I am quite new to WriteableBitmapEx. I tried to load a png file in a WinRT Project by using a WriteableBitmap object and WriteableBitmapEx included via nuget.
The Image is http://commons.wikimedia.org/wiki/File:Plan.cathedrale.Amiens.png
My code is
I would very much appreciate any help.
Best Regards,
Andreas
The Image is http://commons.wikimedia.org/wiki/File:Plan.cathedrale.Amiens.png
My code is
async void MainPage_Loaded(object sender, RoutedEventArgs e)
{
WriteableBitmap image = new WriteableBitmap(100, 100);
StorageFile file = await Package.Current.InstalledLocation.GetFileAsync("Assets\\Plan_cathedrale_Amiens.png");
IRandomAccessStreamWithContentType randomAccessStream = await file.OpenReadAsync();
image.SetSource(randomAccessStream);
this.Transform(image);
}
private void Transform(WriteableBitmap source)
{
Color bottomleft = source.GetPixel(5, 5);
}
The line Color bottomleft = source.GetPixel(5, 5); is the one goind bad and throwing an AccessViolationException. I would very much appreciate any help.
Best Regards,
Andreas