Is it possible to convert a byte[] to a bitmapsource?
问题 So far I have: using (MemoryStream ms = new MemoryStream(imageData)) { Bitmap img = (Bitmap)Image.FromStream(ms); } And then I would imagine I would be able to get a BitmapSource from img somehow? If this is totally wrong please feel free to correct me. 回答1: Try using BitmapSource.Create(). But you need to create pallete first: var colors = new List<Color>(); colors.Add(Colors.Red); colors.Add(Colors.Blue); colors.Add(Colors.Green); var palette = new BitmapPalette(colors); 回答2: Got the