//WriteableBitmap to ARGB byte array
public static byte[] ToByteArray(this WriteableBitmap bmp)
{
   int[] p = bmp.Pixels;
   int len = p.Length * 4;
   byte[] result = new byte[len]; // ARGB
   Buffer.BlockCopy(p, 0, result, 0, len);
   return result;
}

//Copy ARGB byte array into WriteableBitmap
public static void FromByteArray(this WriteableBitmap bmp, byte[] buffer)
{
   Buffer.BlockCopy(buffer, 0, bmp.Pixels, 0, buffer.Length);
}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-10
  • 2021-06-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-23
猜你喜欢
  • 2021-11-16
  • 2021-10-16
  • 2021-08-16
  • 2021-12-14
  • 2022-12-23
  • 2022-12-23
  • 2022-01-26
相关资源
相似解决方案