public void updateImage() { imagearray // The memory which i get from c++ SlectedImage.Source = LoadImage(imagearray);//set the source Image to the Image controll } public static BitmapImage LoadImage(byte[] imageData) { if (imageData == null || imageData.Length == 0) return null; var image = new BitmapImage(); using (var mem = new MemoryStream(imageData)) { mem.Position = 0; image.BeginInit(); image.CreateOptions = BitmapCreateOptions.PreservePixelFormat; image.CacheOption = BitmapCacheOption.OnLoad; image.UriSource = null; image.StreamSource = mem; image.EndInit(); } image.Freeze(); return image }
Stream
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)