Reputation: 652
How to convert array of pixels int[] to WriteableBitmap in Windows Phone 8? Later on I'd like to save this image to MediaLibrary.
Upvotes: 1
Views: 896
Reputation: 1239
You may use copyTo member function of int[] for copying int[] to WriteableBitmap.
int[] ARGBPx = new int[(int)captureDevice.PreviewResolution.Width * (int)captureDevice.PreviewResolution.Height];
WriteableBitmap writeableBitmap_preview;
ARGBPx.CopyTo(writeableBitmap_preview.Pixels, 0);
writeableBitmap_preview.Invalidate();
Upvotes: 0
Reputation: 1295
The only way I know on Windows Phone is using the WriteableBitmapEx library. In addition to WriteableBitmap it implements an "SetPixel method with various overloads":
http://writeablebitmapex.codeplex.com/
The Library can simply be installed from within Visual Studio 2012:
PROJECT => Manage NuGet Packages => Online => Search for "WriteableBitmapEx"
Upvotes: 1